[Zope3-Users] zope.schema Question

Tim Cook timothywayne.cook at gmail.com
Sun Jul 6 17:44:14 EDT 2008


I have a class attribute defined in an interface as such:

    description=Object(
        title=_(u"Description"),
        description=_(u"Description of the activity."),
        required=True,
    )

I used Object because this attribute can be one of several different
class instances.  

But I get an error:
TypeError: __init__() takes exactly 2 non-keyword arguments (1 given)

When the implementation is attempting to import the interface.

But if I enter a default=None or
 
    description=Object(None,
        title=_(u"Description"),
        description=_(u"Description of the activity."),
        required=True,
    )

I get:
 File
"/home/tim/buildout-eggs/zope.schema-3.4.0-py2.4.egg/zope/schema/_field.py", line 453, in __init__
    raise WrongType
zope.schema._bootstrapinterfaces.WrongType

I do not have these issues using many of the other zope.schema types.

Thanks,
Tim




-- 
Timothy Cook, MSc
Health Informatics Research & Development Services
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook 
Skype ID == timothy.cook 
**************************************************************
*You may get my Public GPG key from  popular keyservers or   *
*from this link http://timothywayne.cook.googlepages.com/home*
**************************************************************
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20080706/b403d0c6/attachment.bin


More information about the Zope3-users mailing list