[Zope-dev] Making PersistentList satisfy zope.schema.List

Adam GROSZER agroszer at gmail.com
Wed Jul 1 04:26:17 EDT 2009


Hello,

I think then it's the widgets bad behavour.
It should do a

``newValue = previousValue.__class__(newItems)``

instead of a dumb

``newValue = list(newItems)``

(Where available of course)
The problem is when the previousValue is None so we can't determine
the the type.

Tuesday, June 30, 2009, 11:04:49 PM, you wrote:


RI> I think it's different. If you use a zope.schem.List field
RI> the widgets will store the list at once. This whould replace
RI> the initial created PeristentList. (or not?)

RI> In general if you store a simple list as attribute on a 
RI> persistent class it's fine, everything is stored.

RI> If you like to append or pop from this list, then yes, you
RI> will need a PersistentList otherwise the changes in the 
RI> list are not stored back to the DB. (right?)

RI> Fazit,
RI> the zope.schema.List field and the Sequence widget
RI> is not compatible with initial PersitentList beause
RI> the widget will probably replace the list with a
RI> simple list.

RI> Note, I'm not 100% sure if I'm correct. But it is at
RI> least something which we have to make sure that this
RI> is working.


-- 
Best regards,
 Adam GROSZER                            mailto:agroszer at gmail.com
--
Quote of the day:
If you risk nothing, then you risk everything. 
- Geena Davis 



More information about the Zope-Dev mailing list