[Grok-dev] Cataloging content in PersistenDict
sebastian at urbantalk.se
Tue Feb 12 09:09:37 EST 2008
For the record... When I moved the content from a PersistentDict to a
grok.Container (removing the event notifications) it started working.
I have no idea what I was doing wrong.
8 feb 2008 kl. 19.17 skrev Leonardo Rochael Almeida:
> I don't see anything wrong with your code, though I'd strongly sugest
> you use one of the BTree flavors, instead of PersistentDict.
> The only benefit a PersistentDict gives you over a std dict is the
> implicit persistence. Other than that, accessing a PersistentDict
> loads it all to memory from the disk, even if all you want to do is a
> single insertion.
> I'd only use PD instead of a BTree if I know the number of stored
> elements will be small.
> On Feb 8, 2008 3:37 PM, Sebastian Ware <sebastian at urbantalk.se> wrote:
>> Can I catalog content in a PersistenDict, or are there other
>> Basically I have this:
>> class Movement(grok.Model):
>> title = 'My object'
>> class Transaction(grok.Model):
>> def __init__(self):
>> self.movements = PersistentDict()
>> def create_stuff(self):
>> mov_id = ...
>> mov = Movement()
>> self.movements[mov_id] = mov
>> class MovementIndex(grok.Indexes):
>> title = grok.index.Field()
>> Should this work?
>> Mvh Sebastian
>> Grok-dev mailing list
>> Grok-dev at zope.org
More information about the Grok-dev