[Grok-dev] Cataloging content in PersistenDict

Sebastian Ware sebastian at urbantalk.se
Fri Feb 8 12:37:48 EST 2008


Can I catalog content in a PersistenDict, or are there other  
requirements?

Basically I have this:

class Movement(grok.Model):
   interface.implements(interfaces.IMovement)
   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
     event.notify(lifecycleevent.ObjectCreatedEvent(mov))
     event.notify(lifecycleevent.ObjectModifiedEvent(mov,  
interfaces.IMovement))

class MovementIndex(grok.Indexes):
     grok.site(MySite)
     grok.context(interfaces.IMovement)
     grok.name('catalog')
     title = grok.index.Field()

Should this work?

Mvh Sebastian



More information about the Grok-dev mailing list