<br><br><div><span class="gmail_quote">On 9/18/07, <b class="gmail_sendername">Martijn Faassen</b> <<a href="mailto:faassen@startifact.com">faassen@startifact.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hey,<br><br>Santiago Videla wrote:<br>[snip]<br>><br>> client.py<br>><br>> class Client(grok.Container ):<br>> implements(IPerson, IClient)<br>><br>> Thie works fine.<br>><br>> But I'm trying to use this:
<br>> in interfaces.py<br>> class IClient(IPerson)<br>> ...<br>> in client.py<br>> class Client(grok.Container):<br>> implements(IClient)<br>><br>> but when I try to edit a client instance i get this:
<br>><br>> File "/home/sancho/buildout-eggs/grok-0.10-py2.4.egg/grok/formlib.py",<br>> line 18, in success<br>> return self.success_handler(self.form, **data)<br>> File "/home/sancho/revoluciones/proyectos/sac/Sac/src/sac/client.py",
<br>> line 109, in save<br>> self.applyData(self,**data)<br>> File<br>[...]<br>> TypeError: ('Could not adapt', <sac.client.EditClient object at<br>> 0x99de3ac>, <InterfaceClass sac.interfaces.IPerson
>)<br><br>Can you show us this sac.client.EditClient class?</blockquote><div><br>Hey,<br><br>in client.py, I defined<br><br>class EditClient(grok.EditForm):<br> grok.context(Client)<br> grok.name('edit')<br>
form_fields = grok.AutoFields(Client)<br> template = grok.PageTemplateFile('<a href="http://form.pt">form.pt</a>')<br> form_title = u'Edit client'<br><br> @grok.action("Save")<br> def save(self, **data):
<br> self.applyData(self,**data)<br> self.redirect(self.url(self.context))<br> <br>And I also have<br><br>class AddClient(grok.AddForm):<br> grok.context(ClientsContainer)<br><br> form_fields = grok.AutoFields
(Client)<br> template = grok.PageTemplateFile('<a href="http://form.pt">form.pt</a>')<br> form_title = u'Add client'<br><br> @grok.action("Add client")<br> def add(self, **data):<br> client = Client()
<br> self.applyData(client, **data)<br> name = INameChooser(self.context).chooseName('client', client)<br> self.context[name] = client<br> self.redirect(self.url(self.context))<br><br>the AddClient form works fine using
<br><br>class IClient(IPerson)<br><br>class Client(grok.Container ):<br> implements(IClient)<br><br>but when I go to edit, i get the error<br><br>thanks in advance<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Regards,<br><br>Martijn<br><br>_______________________________________________<br>Grok-dev mailing list<br><a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/grok-dev">
http://mail.zope.org/mailman/listinfo/grok-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Santiago Videla<br><a href="http://www.revolucionesweb.com.ar">www.revolucionesweb.com.ar</a><br><br>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@s tod@s somos.