Hi Darryl
El mié, 26-07-2006 a las 00:48 +1200, Darryl Cousins escribió:
> Hi Lorenzo,
>
> Cool. Where is the `contained` imported from? There is some magic there
> because I couldn't get the test to work when creating the FieldIndex in
> your createIndexes method without it.
from zope.app.conta
Hi Lorenzo,
Cool. Where is the `contained` imported from? There is some magic there
because I couldn't get the test to work when creating the FieldIndex in
your createIndexes method without it.
Thanks,
Darryl
On Tue, 2006-07-25 at 13:55 +0200, Lorenzo Gil Sanchez wrote:
> Hi Darryl,
>
> this is
Hi Darryl,
this is how I ended implementing it:
class FilterableContainer(BTreeContainer):
implements(IFilterableContainer)
def __init__(self, catalog=None):
super(FilterableContainer, self).__init__()
self.catalog = contained(LocalCatalog(), self, 'catalog')
def c
Hi All,
I was thinking about that del(self.field) that I threw in. Wouldn't that
remove the object too and therefore the key reference?
Apparently not (in the test anyway)::
>>> class TestField(Persistent):
... id = u''
... def __init__(self, id):
... self.id = i
Hi Lorenzo,
I got this test to work::
>>> class TestField(Persistent):
... pass
>>> class TestCase(Persistent):
... def __init__(self):
... self.fieldkey = KeyReferenceToPersistent(TestField())
>>> t = TestCase()
Traceback (most recent call last):
No worries, in fact I actually tried the same aproach and hit the same
problem
Thanks anyway
Lorenzo
El mar, 25-07-2006 a las 22:16 +1200, Darryl Cousins escribió:
> Hi again,
>
> I was a too hasty. Because it is the FieldIndex that is missing the
> _p_oid attribute, and the fix I offered is fo
Hi again,
I was a too hasty. Because it is the FieldIndex that is missing the
_p_oid attribute, and the fix I offered is for the container. Sorry
about that.
I need more thinking.
Regards,
Darryl
On Tue, 2006-07-25 at 22:10 +1200, Darryl Cousins wrote:
> Hi Lorenzo,
>
> The key reference adap
Hi Lorenzo,
The key reference adapter can only get a key reference **after** the
object is added to the database (because it uses _p_oid).
The problem could be fixed with a subscriber to IObjectAddedEvent::
def FilterableContainerInitializationHandler(object, event):
"""Initialize contai
Hi,
I have a special Folder content. When an instance of this class is
created I want to create a catalog and an index in its __init__ method.
Something like:
class FilterableContainer(BTreeContainer):
implements(IFilterableContainer)
def __init__(self):
super(FilterableContaine