You are not logged in Log in Join
You are here: Home » Members » AndrewWilcox » Persistent List and Dictionary » dc_view

Log in
Name

Password

 
 


Dublin Core Elements

The Dublin Core metadata element set is a standard for cross-domain information resource description.
Element Description Value
Identifier resource ID http://old.zope.org/Members/AndrewWilcox/PersistentListDict
Title resource name Persistent List and Dictionary
Description resource summary <p>The PersistentDict and PersistentList classes implement persistent dictionaries and lists. These recognize when they've been modified, and trigger the ZODB persistence mechanism. <p>PersistentDict is similar to the PersistentMapping that comes with Zope, but it does not restrict keys to be strings, and does not hide keys that begin with an underscore. <p>For example, here's a class that uses a regular Python list. Because the ZODB doesn't know when the list has been modified automatically, the programmer needs to trigger persistence by setting one of the object attributes. <pre> class Myclass (Persistent): def __init__(self): self.l = [1, 2, 3, 4, 5, 6] def act(self): l = self.l l[2:4] = [33, 37, 39, 41, 44] self.l = l </pre> <p>By using a PersistentList, the ZODB will know when the list has been changed. <pre> class Myclass (Persistent): def __init__(self): self.l = PersistentList([1, 2, 3, 4, 5, 6]) def act(self): self.l[2:4] = [33, 37, 39, 41, 44] </pre>
Creator resource creator ZopeOrgSite
Date default date 2000-07-21 05:28:45
Format resource format text/html
Type resource type Software Package
Subject resource keywords Helpers
Contributors resource collaborators
Language resource language
Publisher resource publisher No publisher
Rights resource copyright


Additional Zope Elements

Element Description Value
CreationDate date resource created 2000-07-21 05:28:45
ModificationDate date resource last modified 2000-07-21 05:28:45
EffectiveDate date resource becomes effective None
ExpirationDate date resource expires None

Backlinks: via Google / Technorati