[Grok-dev] About interfaces
Santiago Videla
santiago.videla at gmail.com
Tue Sep 18 16:04:39 EDT 2007
I have somethig like this:
interfaces.py
class IPerson(Interface):
"""
Personal data interface
"""
fullname = schema.TextLine(title=u"Fullname",
description=u"Enter the person fullname",
required=True,
default=u'',
)
...
class IClient(Interface):
"""
Client of the company
"""
client_type = schema.Choice(title=u"Client type",
required=True,
description=u"Select the client type",
values=['Bank','Broker','Other'],)
...
client.py
class Client(grok.Container):
implements(IPerson, IClient)
Thie works fine.
But I'm trying to use this:
in interfaces.py
class IClient(IPerson)
...
in client.py
class Client(grok.Container):
implements(IClient)
but when I try to edit a client instance i get this:
File "/home/sancho/buildout-eggs/grok-0.10-py2.4.egg/grok/formlib.py",
line 18, in success
return self.success_handler(self.form, **data)
File "/home/sancho/revoluciones/proyectos/sac/Sac/src/sac/client.py", line
109, in save
self.applyData(self,**data)
File "/home/sancho/buildout-eggs/grok-0.10-py2.4.egg/grok/components.py",
line 424, in applyData
self.adapters, update=True)
File "/home/sancho/buildout-eggs/grok-0.10-py2.4.egg/grok/formlib.py",
line 139, in apply_data_event
changes = apply_data(context, form_fields, data, adapters, update)
File "/home/sancho/buildout-eggs/grok-0.10-py2.4.egg/grok/formlib.py",
line 118, in apply_data
adapter = interface(context)
TypeError: ('Could not adapt', <sac.client.EditClient object at 0x99de3ac>,
<InterfaceClass sac.interfaces.IPerson>)
help please?
--
Santiago Videla
www.revolucionesweb.com.ar
Sigue la mata dando de que hablar siempre abajo y a la izquierda donde el
pensamiento que se hace corazón resplandece con la palabra sencilla y
humilde que l at s tod at s somos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20070918/7eeaa917/attachment.htm
More information about the Grok-dev
mailing list