[PEAK] What's the right way to remove entries from an EntityDM

Phillip J. Eby pje at telecommunity.com
Mon Mar 21 11:28:49 EST 2005


At 02:44 PM 03/21/2005 -0100, Tiago Cogumbreiro wrote:
>Hello list,
>I've been playing with PEAK and wrote an snip with the same "spirit"
>of the bulletins example. However I've noticed that something is
>missing in the example. What is the correct way to remove elements an
>EntityDM?
>
> From what i've seen in it's interface there's no mention on this
>subject, nor there is any in QueryDM. I've overritten __delitem__ so
>that it works as current __getitem__ does, by the oid.

It's entirely up to you.  I personally favor 'dm.remove(ob)', as to me it's 
like removing an item from a list or set.  peak.schema will use this 
approach when it arrives, as it will treat a database as just a giant set 
of objects.  So 'db.add(ob)' and 'db.remove(ob)' will be used to add and 
remove objects.


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             


More information about the PEAK mailing list