Commit 5e2e0753 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 922b606d
...@@ -316,10 +316,17 @@ func (b *Bucket) PySetState(pystate interface{}) error { ...@@ -316,10 +316,17 @@ func (b *Bucket) PySetState(pystate interface{}) error {
// ---- register classes to ZODB ---- // ---- register classes to ZODB ----
func bucketNew(base *zodb.PyPersistent) zodb.IPyPersistent { return &Bucket{PyPersistent: base} } func bucketNew(base *zodb.Persistent) zodb.IPersistent {
func btreeNew(base *zodb.PyPersistent) zodb.IPyPersistent { return &BTree{PyPersistent: base} } // XXX simplify vvv
return &Bucket{PyPersistent: &zodb.PyPersistent{Persistent: base}}
}
func btreeNew(base *zodb.Persistent) zodb.IPersistent {
// XXX simplify vvv
return &BTree{PyPersistent: &zodb.PyPersistent{Persistent: base}}
}
func init() { func init() {
zodb.PyRegisterClass("zodb.BTree.LOBucket", bucketNew) zodb.RegisterClass("zodb.BTree.LOBucket", bucketNew)
zodb.PyRegisterClass("zodb.BTree.LOBtree", btreeNew) zodb.RegisterClass("zodb.BTree.LOBtree", btreeNew)
} }
...@@ -25,6 +25,7 @@ import ( ...@@ -25,6 +25,7 @@ import (
) )
// IPyPersistent is the interface that every in-RAM object representing Python ZODB object implements. // IPyPersistent is the interface that every in-RAM object representing Python ZODB object implements.
// XXX kill
type IPyPersistent interface { type IPyPersistent interface {
IPersistent IPersistent
...@@ -40,8 +41,8 @@ type IPyPersistent interface { ...@@ -40,8 +41,8 @@ type IPyPersistent interface {
// PyPersistent is common base implementation for in-RAM representation of ZODB Python objects. // PyPersistent is common base implementation for in-RAM representation of ZODB Python objects.
type PyPersistent struct { type PyPersistent struct {
Persistent *Persistent // XXX remove ptr
pyclass pickle.Class pyclass pickle.Class // XXX kill
} }
//func (pyobj *PyPersistent) PyClass() pickle.Class { return pyobj.pyclass } //func (pyobj *PyPersistent) PyClass() pickle.Class { return pyobj.pyclass }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment