Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fields don't get moved from contentclass to interface if not from zope.schema #4

Closed
iham opened this issue Sep 9, 2014 · 1 comment

Comments

@iham
Copy link

iham commented Sep 9, 2014

I've tried to add other dexterity fields then e.g. textline or uri to a content_type uml.
(Relation, NamedBlobFile, ...)

these are not placed in the content_type interface.
but they are placed in the content_type implementation class if i decide to in the content_type uml via create_contentclass = true.

looks like, in dxgenerator.py line 275 is the "problem":

    for att in klass.attributes():
        # move only schema attributes
        if att.value == 'None' or att.value.startswith('schema.'):
        klass.detach(att.__name__)
        if not schemaclass.attributes(att.targets[0]):
            schemaclass.insertlast(att)
        else:
            del att

this moves only zope.schema.* fields to the interface class, but Relation field, etc isn't from there. so this stays in the content class (and becomes deleted afterwards, if create_contentclass = false)

i've tried and tested it without the

if att.value == 'None' or att.value.startswith('schema.'):

and it works as a charm.

any suggestions why only zope.schema fields should be allowed?

thanks

@zworkb zworkb closed this as completed in 25c704d Sep 9, 2014
@zworkb
Copy link
Member

zworkb commented Sep 9, 2014

fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants