Re: [Zope3-Users] formlib problem
On Friday 14 April 2006 11:00, Stéphane Brault wrote: I'm trying to use formlib but I get a problem : Traceback (most recent call last): File pyshell#103, line 1, in -toplevel- print MyForm(None, request)() File pyshell#100, line 6, in __call__ widgets = form.setUpWidgets(self.form_fields, 'form', self.context, self.request, ignore_request=ignore_request) File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in setUpWidgets IInputWidget) File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://127.0.0.1), , u'') This problem occurs with my objects (which are sqlos objects) but also when I try the examples of the form.txt. I must be doing something wrong, but I can't figure it out, especially since I follow the examples. Any hint ? Without more context, this traceback is not very helpful. Did you copy this traceback from the Web site, because the important info in the error message is missing? Regards, Stephan -- Stephan Richter CBU Physics Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re : Re : [Zope3-Users] formlib problem
Hi, when I use formlib the traditional way (registering the page via ZCML, going to it via the ZMI), everything works fine. The problem is I can't access it programatically. The thing I try to do is : - call a method via JSON RPC (by the way jsonserver is great ;-)) - in this method I get my object (through sqlos, which is nice too ;-)) and then call the formlib class to render my page in html - send back the html which is used to update my page. Has anyone tried to use formlib this way, I really need to use AJAX and it seems that I can't have both working together, I must be missing something. Thanks, Stéphane - Message d'origine De : Stéphane Brault [EMAIL PROTECTED] À : zope3-users@zope.org Envoyé le : Mardi, 18 Avril 2006, 4h16mn 55s Objet : Re : [Zope3-Users] formlib problem Thanks Michael, There is indeed something missing : ComponentLookupError: (( zope.schema._bootstrapfields.Int object at 0x01A83610 , zope.publisher.browser.TestRequest instance URL=http://127.0.0.1 ), InterfaceClass zope.app.form.interfaces.IDisplayWidget , u'') My problem has nothing to do with containers, since my interface is not a container. It seems that zope can't find the adapters for the shema fields, even when I register them by code. I really don't know what to do from now. The fact is I use AJAX, so I don't need to register my views, I just call them from code to use the generated html as a response to a javascript call that then update my page. Thanks, Stéphane - Message d'origine De : Michael Howitz [EMAIL PROTECTED] À : Stéphane Brault [EMAIL PROTECTED] Cc : user-list zope zope3-users@zope.org Envoyé le : Mardi, 18 Avril 2006, 3h40mn 16s Objet : Re: [Zope3-Users] formlib problem Stéphane Brault wrote: Hi, I can't use formlib, when I run the example in the form.txt I get this error: Traceback (most recent call last): File pyshell#29, line 1, in -toplevel- print MyForm(None, request)() File pyshell#26, line 6, in __call__ widgets = form.setUpWidgets(self.form_fields, 'form', self.context, self.request, ignore_request= ignore_request) File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in setUpWidgets IInputWidget) File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://127.0.0.1), , u'') There seems to be something missing before , http... ... did you copy it form the browser output? It happens when setUpWidgets is called in the first example, do I need to import something or to configure a component for formlib to work ? Any hint ? Guess out of the dust: does the interface of the object you want to display have a zope.app.container.constraints.containers directive? This thread seems similar to your problem. http://mail.zope.org/pipermail/zope3-users/2006-March/002802.html HTH, mac ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re : [Zope3-Users] formlib problem
at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 352 in interpret = 'handlers[opcode](self, args)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 976 in do_defineSlot = 'self.interpret(block)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 352 in interpret = 'handlers[opcode](self, args)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 625 in do_insertText_tal = 'text = self.engine.evaluateText(stuff[0])' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\app\pagetemplate\engine.py line 101 in evaluateText = 'text = self.evaluate(expr)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tales\tales.py line 696 in evaluate = 'return expression(self)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tales\expressions.py line 249 in __call__ = 'v = var(econtext)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tales\expressions.py line 205 in __call__ = 'return self._eval(econtext)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tales\expressions.py line 199 in _eval = 'return ob()' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\app\pagetemplate\talesapi.py line 73 in title_or_name = return getattr(self, 'title', '') or zapi.name(self.context) ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\app\traversing\api.py line 149 in getName = 'return IPhysicallyLocatable(obj).getName()' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\interface\interface.py line 682 in __call__ = 'raise TypeError(Could not adapt, obj, self)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) 127.0.0.1 - - [19/Apr/2006:16:13:32 +0200] POST /netevenTest/test/neteven.Accounts.1/ HTTP/1.1 200 163 - Mozilla/5.0 (Windows; U; Windows NT 5.1; fr-FR; rv:1.7.12) Gecko/20050919 Firefox/1.0.7 It seems that retrieving my object from code doesn't give me an address for it, which would cause the problem with IPhysicallyLocatable (my uninformed guess). Is there a way to solve the problem, knowing that my object is retrieved through sqlos, and thus has no true address ? There might be something else but being quite new to zope 3 (and enjoying it, thanks to you all guys), I can't figure it out. Thanks, Stéphane - Message d'origine De : Stéphane Brault [EMAIL PROTECTED] À : user-list zope zope3-users@zope.org Envoyé le : Mercredi, 19 Avril 2006, 4h05mn 07s Objet : Re : Re : [Zope3-Users] formlib problem Hi, when I use formlib the traditional way (registering the page via ZCML, going to it via the ZMI), everything works fine. The problem is I can't access it programatically. The thing I try to do is : - call a method via JSON RPC (by the way jsonserver is great ;-)) - in this method I get my object (through sqlos, which is nice too ;-)) and then call the formlib class to render my page in html - send back the html which is used to update my page. Has anyone tried to use formlib this way, I really need to use AJAX and it seems that I can't have both working together, I must be missing something. Thanks, Stéphane - Message d'origine De : Stéphane Brault [EMAIL PROTECTED] À : zope3-users@zope.org Envoyé le : Mardi, 18 Avril 2006, 4h16mn 55s Objet : Re : [Zope3-Users] formlib problem Thanks Michael, There is indeed something missing : ComponentLookupError: (( zope.schema._bootstrapfields.Int object at 0x01A83610 , zope.publisher.browser.TestRequest instance URL=http://127.0.0.1
Re: Re : [Zope3-Users] formlib problem
Stéphane Brault wrote: Hi again, sorry to be a bore ;-) I keep on trying to use formlib, I no longer have a problem of adapters for my fields but I get this error: 2006-04-19T16:13:32 ERROR root C:\Python24\Lib\site-packages\zope\publisher\publish.py line 138 in publish = 'result = publication.callObject(request, object)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\app\publication\zopepublication.py line 161 in callObject = 'return mapply(ob, request.getPositionalArguments(), request)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\publisher\publish.py line 113 in mapply = 'return debug_call(object, args)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\publisher\publish.py line 119 in debug_call = 'return object(*args)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) c:\ZopeInst\lib\python\neteven\database\items.py line 43 in getItemEdit = 'return ItemsForm(item, self.request).render()' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\formlib\form.py line 733 in render = 'self.form_result = self.template()' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\app\pagetemplate\viewpagetemplatefile.py line 83 in __call__ = 'return self.im_func(im_self, *args, **kw)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\app\pagetemplate\viewpagetemplatefile.py line 51 in __call__ = sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0), ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\pagetemplate\pagetemplate.py line 117 in pt_render = 'strictinsert=0, sourceAnnotations=sourceAnnotations)()' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 277 in __call__ = 'self.interpret(self.program)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 352 in interpret = 'handlers[opcode](self, args)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceCla ss zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 878 in do_defineMacro = 'self.interpret(macro)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 352 in interpret = 'handlers[opcode](self, args)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 926 in do_extendMacro = 'definingName, extending)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 908 in do_useMacro = 'self.interpret(macro)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 352 in interpret = 'handlers[opcode](self, args)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 538 in do_optTag_tal = 'self.do_optTag(stuff)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 523 in do_optTag = 'return self.no_tag(start, program)' ** exceptions.TypeError: ('Could not adapt', Items at 0x3d7ce30, InterfaceClass zope.app.traversing.interfaces.IPhysicallyLocatable) C:\Python24\Lib\site-packages\zope\tal\talinterpreter.py line 518 in no_tag = 'self.interpret(program)' ** exceptions.TypeError:
Re: Re : Re : [Zope3-Users] formlib problem
Stéphane Brault wrote: Hi Jim, the Items object is my object, linked to my items, table which implements the IItems interface I use for my form: from neteven.interfaces.items import IItems from zope.formlib import form class ItemsForm(form.EditForm): form_fields = form.Fields(IItems) form_fields = form_fields.omit('dateLastUpdate') Items is defined this way: from zope.interface import implements from sqlobject import * from sqlos import SQLOS from neteven.interfaces.items import IItems class Items(SQLOS): implements(IItems) class sqlmeta: table = 'items' When I add this zcml declaration : browser:page for=.interfaces.items.IItems name=edit.html class=.forms.items.ItemsForm menu=zmi_views title=Edit a Item permission=zope.ManageContent / everything works fine from the ZMI (I created simple containers to test that). My JSON server side code is: def getItemEdit(self, itemId): item = Items.get(itemId) #a sqlos function to get an Item instance from the table given its Id return ItemsForm(item, self.request)() The fact is I don't use any page template right now ( though I might do this later to have a nice GUI). Actually, you are using a page template. Calling ItemsForm() invokes the render() method of zope.formlib.form.FormBase, which uses pageform.pt in the zope.formlib folder by default. This is where title_or_id is requested. You may wish to set a different template for your ItemsForm class. Have you tried subclassing form.SubPageEditForm instead of form.EditForm? -Jim Washington ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: FW: Re : Re : [Zope3-Users] formlib problem
Stéphane, i'm working on what sounds to be a pretty much identical issue currently... i'm attempting to use formlib and jsonserver. i've been throwing around a number of possible solutions, but none that i'm comfortable with so far. i agree, i don't know how to access my form.Form class programmatically, but i don't want to sacrifice all the utility provided me by formlib (errors, checking of invariants, etc, etc). i've considered having my exposed json-rpc methods pull in the params explicitly, and then wrap them back up into formlib-style data (if it's possible, i haven't had a chance to try yet), and then use the handleSubmit and applyChanges logic out of formlib directly. but i'm not happy with that solution. i would like to find a way to build my forms agnostic of how they're to be used, and associate jsonrpc:view's to a particular content area that can access the forms i've displayed. i've been really happy with the ability to build formlib forms into viewlets, and use them where/how i want... but if that keeps them from being ajax-y accessible, it will present a significant hurdle :\ if anyone has any suggestions, or has solved this kind of problem before, i'd really appreciate pointers. if i stumble across anything that seems useful, i'll post it back out. Pete -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stéphane Brault Sent: Wednesday, April 19, 2006 10:05 AM To: user-list zope Subject: Re : Re : [Zope3-Users] formlib problem Hi, when I use formlib the traditional way (registering the page via ZCML, going to it via the ZMI), everything works fine. The problem is I can't access it programatically. The thing I try to do is : - call a method via JSON RPC (by the way jsonserver is great ;-)) - in this method I get my object (through sqlos, which is nice too ;-)) and then call the formlib class to render my page in html - send back the html which is used to update my page. Has anyone tried to use formlib this way, I really need to use AJAX and it seems that I can't have both working together, I must be missing something. Thanks, Stéphane - Message d'origine De : Stéphane Brault [EMAIL PROTECTED] À : zope3-users@zope.org Envoyé le : Mardi, 18 Avril 2006, 4h16mn 55s Objet : Re : [Zope3-Users] formlib problem Thanks Michael, There is indeed something missing : ComponentLookupError: (( zope.schema._bootstrapfields.Int object at 0x01A83610 , zope.publisher.browser.TestRequest instance URL=http://127.0.0.1 ), InterfaceClass zope.app.form.interfaces.IDisplayWidget , u'') My problem has nothing to do with containers, since my interface is not a container. It seems that zope can't find the adapters for the shema fields, even when I register them by code. I really don't know what to do from now. The fact is I use AJAX, so I don't need to register my views, I just call them from code to use the generated html as a response to a javascript call that then update my page. Thanks, Stéphane - Message d'origine De : Michael Howitz [EMAIL PROTECTED] À : Stéphane Brault [EMAIL PROTECTED] Cc : user-list zope zope3-users@zope.org EnvoyÃ(c) le : Mardi, 18 Avril 2006, 3h40mn 16s Objet : Re: [Zope3-Users] formlib problem Stéphane Brault wrote: Hi, I can't use formlib, when I run the example in the form.txt I get this error: Traceback (most recent call last): File pyshell#29, line 1, in -toplevel- print MyForm(None, request)() File pyshell#26, line 6, in __call__ widgets = form.setUpWidgets(self.form_fields, 'form', self.context, self.request, ignore_request= ignore_request) File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in setUpWidgets IInputWidget) File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://127.0.0.1), , u'') There seems to be something missing before , http... ... did you copy it form the browser output? It happens when setUpWidgets is called in the first example, do I need to import something or to configure a component for formlib to work ? Any hint ? Guess out of the dust: does the interface of the object you want to display have a zope.app.container.constraints.containers directive? This thread seems similar to your problem. http://mail.zope.org/pipermail/zope3-users/2006-March/002802.html HTH, mac ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- All guilt is relative, loyalty counts, and never let your conscience be your guide. - Lucas Buck, American Gothic
[Zope3-Users] formlib problem
Hi, I can't use formlib, when I run the example in the form.txt I get this error: Traceback (most recent call last): File pyshell#29, line 1, in -toplevel- print MyForm(None, request)() File pyshell#26, line 6, in __call__ widgets = form.setUpWidgets(self.form_fields, 'form', self.context, self.request, ignore_request= ignore_request) File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in setUpWidgets IInputWidget) File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://127.0.0.1), , u'') It happens when setUpWidgets is called in the first example, do I need to import something or to configure a component for formlib to work ? Any hint ? Thanks, Stéphane ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] formlib problem
Stéphane Brault wrote: Hi, I can't use formlib, when I run the example in the form.txt I get this error: Traceback (most recent call last): File pyshell#29, line 1, in -toplevel- print MyForm(None, request)() File pyshell#26, line 6, in __call__ widgets = form.setUpWidgets(self.form_fields, 'form', self.context, self.request, ignore_request= ignore_request) File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in setUpWidgets IInputWidget) File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://127.0.0.1), , u'') There seems to be something missing before , http... ... did you copy it form the browser output? It happens when setUpWidgets is called in the first example, do I need to import something or to configure a component for formlib to work ? Any hint ? Guess out of the dust: does the interface of the object you want to display have a zope.app.container.constraints.containers directive? This thread seems similar to your problem. http://mail.zope.org/pipermail/zope3-users/2006-March/002802.html HTH, mac ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re : FW: [Zope3-Users] formlib problem
Thanks Pete, I registered the adapters in the shell and it works. The trouble is that I have the same problem from zope. It seems that the adapters for the shema fields are not registered, therefore I can't have formlib working, even when I register the adapters by code. I don't know what to do. The fact is I use AJAX, so I don't have to register my pages, since they are never called, but used to generate the html I use to update my pages (which works fine otherwise). Maybe this explains the behaviour I get, but I doubt it. Stéphane - Message d'origine De : Pete Taylor [EMAIL PROTECTED] À : [EMAIL PROTECTED] Envoyé le : Mardi, 18 Avril 2006, 2h13mn 10s Objet : Re: FW: [Zope3-Users] formlib problem formlib works just fine, but from the shell i haven't had much luck either. probably need to look at the test suite that runs with form.txt and do the necessary setup for it to work correctly. i found it easier just to build a few sample forms and zcml, and learn by doing since getting the shell to work right was kinda a pain ;) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stéphane Brault Sent: Tuesday, April 18, 2006 7:42 AM To: user-list zope Subject: [Zope3-Users] formlib problem Hi, I can't use formlib, when I run the example in the form.txt I get this error: Traceback (most recent call last): File pyshell#29, line 1, in -toplevel- print MyForm(None, request)() File pyshell#26, line 6, in __call__ widgets = form.setUpWidgets(self.form_fields, 'form', self.context, self.request, ignore_request= ignore_request) File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in setUpWidgets IInputWidget) File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://127.0.0.1), , u'') It happens when setUpWidgets is called in the first example, do I need to import something or to configure a component for formlib to work ? Any hint ? Thanks, Stéphane ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- All guilt is relative, loyalty counts, and never let your conscience be your guide. - Lucas Buck, American Gothic ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re : [Zope3-Users] formlib problem
Thanks Michael, There is indeed something missing : ComponentLookupError: (( zope.schema._bootstrapfields.Int object at 0x01A83610 , zope.publisher.browser.TestRequest instance URL=http://127.0.0.1 ), InterfaceClass zope.app.form.interfaces.IDisplayWidget , u'') My problem has nothing to do with containers, since my interface is not a container. It seems that zope can't find the adapters for the shema fields, even when I register them by code. I really don't know what to do from now. The fact is I use AJAX, so I don't need to register my views, I just call them from code to use the generated html as a response to a javascript call that then update my page. Thanks, Stéphane - Message d'origine De : Michael Howitz [EMAIL PROTECTED] À : Stéphane Brault [EMAIL PROTECTED] Cc : user-list zope zope3-users@zope.org Envoyé le : Mardi, 18 Avril 2006, 3h40mn 16s Objet : Re: [Zope3-Users] formlib problem Stéphane Brault wrote: Hi, I can't use formlib, when I run the example in the form.txt I get this error: Traceback (most recent call last): File pyshell#29, line 1, in -toplevel- print MyForm(None, request)() File pyshell#26, line 6, in __call__ widgets = form.setUpWidgets(self.form_fields, 'form', self.context, self.request, ignore_request= ignore_request) File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in setUpWidgets IInputWidget) File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://127.0.0.1), , u'') There seems to be something missing before , http... ... did you copy it form the browser output? It happens when setUpWidgets is called in the first example, do I need to import something or to configure a component for formlib to work ? Any hint ? Guess out of the dust: does the interface of the object you want to display have a zope.app.container.constraints.containers directive? This thread seems similar to your problem. http://mail.zope.org/pipermail/zope3-users/2006-March/002802.html HTH, mac ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] formlib problem
Hi, I'm trying to use formlib but I get a problem : Traceback (most recent call last): File pyshell#103, line 1, in -toplevel- print MyForm(None, request)() File pyshell#100, line 6, in __call__ widgets = form.setUpWidgets(self.form_fields, 'form', self.context, self.request, ignore_request=ignore_request) File C:\Python24\Lib\site-packages\zope\formlib\form.py, line 255, in setUpWidgets IInputWidget) File C:\Python24\Lib\site-packages\zope\component\__init__.py, line 154, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://127.0.0.1), , u'') This problem occurs with my objects (which are sqlos objects) but also when I try the examples of the form.txt. I must be doing something wrong, but I can't figure it out, especially since I follow the examples. Any hint ? Thanks, Stéphane ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users