New issue 221 by rafaelbco: Code of packages that enable versioning need
review/merge
http://code.google.com/p/dexterity/issues/detail?id=221
The current versioning story is documented here [1]. Two packages in the
collective are needed to enable versioning: collective.dexteritydiff and
collective.cmfeditionsdexteritycompat. As discussed in the mailing list [2]
these packages need review and perhaps merging into
plone.app.versioningbehavior.
Comment #1 on issue 221 by dgl...@gmail.com: Code of packages that enable
versioning need review/merge
http://code.google.com/p/dexterity/issues/detail?id=221
(No comment was entered for this change.)
Following the documentation above I ran into an error with versioning and
the keywords-field provided by the default-metadata-behaviour.
collective.dexteritydiff iterates over the fields in the schema with
getFieldsInOrder resulting in an AttributeError on "subjects" since the
instance only responds to "subject":
(Pdb) pp getFieldsInOrder(schema)
[('title', <zope.schema._bootstrapfields.TextLine object at 0x10720b190>),
('description', <zope.schema._bootstrapfields.Text object at 0x10720b250>),
('subjects', <zope.schema._field.Tuple object at 0x1071f8f90>),
('language', <zope.schema._field.Choice object at 0x10720b390>),
('effective', <zope.schema._field.Datetime object at 0x107207bd0>),
('expires', <zope.schema._field.Datetime object at 0x10720b490>),
('creators', <zope.schema._field.Tuple object at 0x10720b5d0>),
('contributors', <zope.schema._field.Tuple object at 0x10720b690>),
('rights', <zope.schema._bootstrapfields.Text object at 0x10720b6d0>)]
(Pdb) obj1.subjects
*** AttributeError: subjects
(Pdb) obj1.subject
(u'fsgdsa',)
(Pdb) obj2.subject
(u'fsgdsa', u'tree')
I was not sure about how to proceed from here...
@derschmock: Field values are not necessarily available as attributes of
the item. That should be the case for fields on the main schema, but for
fields coming from behaviors, you have to adapt the item to the behavior
interface and then access attributes of the behavior adapter.