The implementation of applyData returns lists that aren't automatically persistent.

Bug #419305 reported by jhsware
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grok
Invalid
Undecided
Unassigned
zope.formlib
Invalid
Undecided
Unassigned

Bug Description

If you have a form based on a schema.List item,

  tags = schema.List(title=u"Content Tags", value_type=schema.Choice(title=u"Content Tag", vocabulary='Content Tags'), default = [])

then applyData stores the results as a regular list() data type instead of the persistent PersistenList() data type. This is ok as long as you only manipulate the data with applyData, but that is quite a wild assumption.

I suggest changing the implementation of applyData to ALLWAYS use persistent data types, such as PersistentList. Otherwise an oversight might lead to very subtle but serious bugs resulting in loss of data.

Revision history for this message
trollfot (trollfot) wrote :

The result of a form is not always meant to be persistent.
The persistency is usually implemented in the Model itself, when you set the value of the attribute, for example.
The behavior described here is the intended one.

Changed in zope.formlib:
status: New → Invalid
Changed in grok:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.