plone/plone.dexterity — pull request #18 by thet (2014-04-02 22:22:59+00:00)
Title: utils.createContent better behavior support

Let utils.createContent also handle setting of attributes on behaviors, which derive from other behaviors.\

this pull-request extends @toutpt change of behavior support for createContent to also support derived behaviors, which are made of several ones.
e.g. plone.app.dexterity.behaviors.metadata.IDublinCore is made up of IBasic, ICategorization, etc. But `schema.names()` in https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/utils.py#L143 returns an empty list.
This change iterates over fieldnames and sets it on the behavior, if the behavior has an attribute with this name.
this now correctly utilizes the ICategorization behavior, when someone uses createContent with a `subjects` keyword, where the behavior sets it `context.subject`. Related is: https://github.com/plone/plone.app.dexterity/issues/118

I don't have a test for this yet. Let's discuss first, if this change makes sense.