Re: [Zope3-Users] z3c.form and subforms in an AddForm?
Hi again Hermann, Thanks again for replying -- the part that perplexed me was that none of my code was ever mentioned in the trackback -- I wasn't sure how I could be causing zope to recurse at all. It turned out that it couldn't find the form code because z3c.formui's zcml files weren't copied in the package includes directory, so zope kept falling back to my template.pt until it threw a recursion exception. So it was related to a series of other install errors (i didn't have macro installed correctly either, which is what causes the initial recursion error; once macro went in, I started getting adapter errors, which led me to check on formui, which wasn't in correctly either) -- for some reason, when I easy_install Z3C packages, their .zcml files don't end up in my zope skel directory. I finally figured our a bash command to compare all the .zcml files I should have all the ones I actually had. To avoid having such a goofy (and slightly embarrassing problem) in the future, does anyone have any recommendations on a document about getting a sane zope development environment setup? I thought it would be similar to getting my Plone environments set up, but this is obviously a bit different, and I'm no good at debugging the messages I get yet. Thanks all, ~Matt On 7/6/07, Hermann Himmelbauer <[EMAIL PROTECTED]> wrote: Am Freitag, 6. Juli 2007 03:14 schrieb Matt Bowen: > Stephan and Hermann, > maximum recursion depth exceeded That is a good hint, so you're recursively calling something. > > /opt/zope/zope- 3.4.0a1 > > /lib/python/zope/tal/talinterpreter.py(379)do_startEndTag() > -> self.do_startTag(stuff, self.endsep, self.endlen) I think I once had this, too, some time ago. The reason was something like calling a function from the template, that again rendered the template, calling the function again and so on, resulting in an endless recursion. Best Regards, Hermann -- [EMAIL PROTECTED] GPG key ID: 299893C7 (on keyservers) FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7 ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] z3c.form and subforms in an AddForm?
Stephan and Hermann, Thank you both so much for all of your help; I can now display my object -- it turned out that my z3c.form had not put its configs in my package-includes, so Stephan's #3 made my display work. Of course, I also fixed some other things that you both suggested, so I know I had other problems. Unfortunately, when I try to use either add or edit, I get the following now: for edit.html I get 127.0.0.1 - - [05/Jul/2007:21:03:22 -0400] "GET /++skin++MovingTargetBrowser/viewguy/edit.html HTTP/1.1" 500 201 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4" exceptions.RuntimeError: maximum recursion depth exceeded /opt/zope/zope-3.4.0a1 /lib/python/zope/tal/talinterpreter.py(379)do_startEndTag() -> self.do_startTag(stuff, self.endsep, self.endlen) I pasted the full trackback for edit here: http://paste.plone.org/15590 For addNextAction.html, I get 127.0.0.1 - - [05/Jul/2007:21:04:37 -0400] "GET /++skin++MovingTargetBrowser/viewguy/edit.html HTTP/1.1" 500 201 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4" exceptions.RuntimeError: maximum recursion depth exceeded /opt/zope/zope-3.4.0a1 /lib/python/zope/tal/talinterpreter.py(226)StringIO() -> return FasterStringIO() I pasted the full traceback for add here: http://paste.plone.org/15589 The tracebacks are 1600+ lines long, so I'm having a little trouble working my way through them to decipher my error, so if anyone has any idea what I've done wrong or has seen anything similar, I'd be grateful to hear. Thank you all for all the help you've already given. Best, Matt On 7/4/07, Stephan Richter <[EMAIL PROTECTED]> wrote: On Wednesday 04 July 2007 12:59, Matt Bowen wrote: > File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form- > 1.3.0-py2.4.egg/z3c/form/form.py", line 144, in __call__ > self.update() > File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form- > 1.3.0-py2.4.egg/z3c/form/form.py", line 139, in update > super(Form, self).update() > File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form- > 1.3.0-py2.4.egg/z3c/form/form.py", line 88, in update > self.updateWidgets() > File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form- > 1.3.0-py2.4.egg/z3c/form/form.py", line 167, in updateWidgets > self.widgets = zope.component.getMultiAdapter( > File "/opt/zope/zope-3.4.0a1/lib/python/zope/component/_api.py", line > 103, in getMultiAdapter > raise ComponentLookupError(objects, interface, name) > zope.component.interfaces.ComponentLookupError: ((< > z3c.pagelet.zcml.NextActionAddForm object at 0x2b69896b4850>, < > zope.publisher.browser.BrowserRequest instance URL= > http://localhost:9080/++skin++MovingTargetBrowser/addNextAction.html>, < > zope.app.folder.folder.Folder object at 0x2b69896eb0c8>), z3c.form.interfaces.IWidgets>, u'') This error tells you that the "widget manager" (implementing ``IWidgets``) cannot be found for your (form, request, context) discriminator. This can really just mean one of the following three things: 1. Your skin "MovingTargetBrowser" does *not* inherit from the ``IFormLayer`` skin. Can you show us your skin definition in Python and the registration in ZCML? 2. Your form does not provide ``IFieldsForm``. What does the following return? >>> from z3c.form import interfaces >>> interfaces.IFieldsForm.providedBy(form) Can you paste your form Python code and the registration? 3. You did not hook up the ZCML files of z3c.form? Are you sure z3c/form/configure.zcml is loaded? This can be checked by causing a syntax error in that file and see whether the startup also breaks. > I keep reading over the .txt files in z3c.form, and I feel like I may be > missing some line. Do I need a datamanager? My schema is pretty > straightforward: No, the data manager and everything else is defined for the common case you are having. 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: [Zope3-Users] Thinking about blog entry structure
Hi Florian, I know that the larger sites (e.g., blogger) use root//MM/title-separated-by-dashes If you expect to support really, really active sites you may want to add Days in there so that it's slightly easier to find an entry. You may also want to support supplemental URLs, such as root/category/NAME so that people can find all of the posts in a given tag easily. I know that lifehacker does something similar. Just as a side note, you should use dashes instead of underscores to separate words in the titles; Google interprets the dash as a space and the underscore as a hyphen (backwards, I know) -- see http://www.movable-type-weblog.com/archive/entry/filename-with-underscore-or-dash.html Good luck! Matt On 7/5/07, Florian Lindner <[EMAIL PROTECTED]> wrote: Hello, I'm currently rethinking my Blog's structure for saving entries. At the moment I use a flat structure with all entries represented by an instance. The naming scheme is like 2007_07_05_Title_of_entry example: [1] But that is not something I really like and I think it will be unhandleable for large blogs. What would you suggest as an organization? Something like 2007/05/Title or even 2007/05/13/Title? Thanks for ideas! Florian [1] http://xgm.de/Blog/2007_05_13_Zeit_für_eine_neue_Suchmaschine ___ 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] z3c.form and subforms in an AddForm?
Hi again, I now have all three forms giving me the component lookup error -- as you sugguested, I changed zope.ManageContent to zope.Public; I'd rather have one problem at a time. I also have a full traceback, because I realized that I didn't include one last night: zope.component.interfaces.ComponentLookupError: ((, < zope.publisher.browser.BrowserRequest instance URL= http://localhost:9080/++skin++MovingTargetBrowser/addNextAction.html>, < zope.app.folder.folder.Folder object at 0x2b69896eb0c8>), , u'') /opt/zope/zope-3.4.0a1 /lib/python/zope/component/_api.py(103)getMultiAdapter() -> raise ComponentLookupError(objects, interface, name) (Pdb) Traceback (most recent call last): File "/opt/zope/python2.4//lib/python2.4/threading.py", line 422, in run self.__target(*self.__args, **self.__kwargs) File "/opt/zope/zope-3.4.0a1/lib/python/twisted/python/threadpool.py", line 148, in _worker context.call(ctx, function, *args, **kwargs) File "/opt/zope/zope-3.4.0a1/lib/python/twisted/python/context.py", line 59, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "/opt/zope/zope-3.4.0a1/lib/python/twisted/python/context.py", line 37, in callWithContext return func(*args,**kw) --- --- File "/opt/zope/zope-3.4.0a1/lib/python/twisted/web2/wsgi.py", line 198, in run result = self.application(self.environment, self.startWSGIResponse) File "/opt/zope/zope-3.4.0a1/lib/python/zope/app/wsgi/__init__.py", line 72, in __call__ return app.__call__(environ, start_response) File "/opt/zope/zope-3.4.0a1/lib/python/zope/app/wsgi/__init__.py", line 54, in __call__ request = publish(request, handle_errors=handle_errors) File "/opt/zope/zope-3.4.0a1/lib/python/zope/publisher/publish.py", line 133, in publish result = publication.callObject(request, obj) File "/opt/zope/zope-3.4.0a1/lib/python/zope/app/publication/zopepublication.py", line 161, in callObject return mapply(ob, request.getPositionalArguments(), request) File "/opt/zope/zope-3.4.0a1/lib/python/zope/publisher/publish.py", line 108, in mapply return debug_call(obj, args) File "/opt/zope/zope-3.4.0a1/lib/python/zope/publisher/publish.py", line 114, in debug_call return obj(*args) File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form- 1.3.0-py2.4.egg/z3c/form/form.py", line 144, in __call__ self.update() File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form- 1.3.0-py2.4.egg/z3c/form/form.py", line 139, in update super(Form, self).update() File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form- 1.3.0-py2.4.egg/z3c/form/form.py", line 88, in update self.updateWidgets() File "/opt/zope/python2.4/lib/python2.4/site-packages/z3c.form- 1.3.0-py2.4.egg/z3c/form/form.py", line 167, in updateWidgets self.widgets = zope.component.getMultiAdapter( File "/opt/zope/zope-3.4.0a1/lib/python/zope/component/_api.py", line 103, in getMultiAdapter raise ComponentLookupError(objects, interface, name) zope.component.interfaces.ComponentLookupError: ((< z3c.pagelet.zcml.NextActionAddForm object at 0x2b69896b4850>, < zope.publisher.browser.BrowserRequest instance URL= http://localhost:9080/++skin++MovingTargetBrowser/addNextAction.html>, < zope.app.folder.folder.Folder object at 0x2b69896eb0c8>), , u'') I keep reading over the .txt files in z3c.form, and I feel like I may be missing some line. Do I need a datamanager? My schema is pretty straightforward: from zope.interface import Interface from zope.schema import Bool, Text, Datetime, TextLine class INextAction(Interface): """Stores next actions, or the next physical thing a person can do for a project""" id = TextLine( title=u'ID', readonly=True, required=True) description = Text( title = u"Description", description = u"What is the next things you can physically do?", required = True ) done = Bool( title = u"Done?", description = u"Is this Next Action complete?", required = False ) due = Datetime( title = u"Due date.", description = u"When must this action be complete?", required = False ) Thanks again for all the advice; I feel like I'm making a little more progress now :) Gratefully, Matt On 7/4/07, Hermann Himmelbauer <[EMAIL PROTECTED]> wrote: Am Mittwoch, 4. Juli 2007 00:33 schrieb Matt Bowen: > That was not at all a silly question! That got me a little closer -- I am > new enough not to have understood that i needed the ++skin++. Now, instead > of a 404 page, I get the following when I try to display my object: > > 1
Re: [Zope3-Users] z3c.form and subforms in an AddForm?
That was not at all a silly question! That got me a little closer -- I am new enough not to have understood that i needed the ++skin++. Now, instead of a 404 page, I get the following when I try to display my object: 127.0.0.1 - - [03/Jul/2007:18:26:54 -0400] "GET /++skin++MovingTargetBrowser/viewguy/ HTTP/1.1" 500 131 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4" zope.component.interfaces.ComponentLookupError: ((, < zope.publisher.browser.BrowserRequest instance URL= http://localhost:9080/++skin++MovingTargetBrowser/viewguy/index.html>, < movingtarget.nextaction.NextAction object at 0x2adbcf6cd2a8>), , u'') /opt/zope/zope-3.4.0a1 /lib/python/zope/component/_api.py(103)getMultiAdapter() -> raise ComponentLookupError(objects, interface, name) And for edit, I get this: 127.0.0.1 - - [03/Jul/2007:18:30:30 -0400] "GET /++skin++MovingTargetBrowser/viewguy/ HTTP/1.1" 500 201 "-" "Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4" zope.security.interfaces.Unauthorized: (, 'browserDefault', 'zope.ManageContent') /opt/zope/zope-3.4.0a1 /lib/python/zope/app/publication/browser.py(66)getDefaultTraversal() -> return ob.browserDefault(request) viewguy is what I called MyNextActionObject. I'm not exactly sure what the error first error means, but at least it's something. The second one has to do with permissions, which I may be able to figure out yet. Thank you! Best, Matt On 7/3/07, Hermann Himmelbauer <[EMAIL PROTECTED]> wrote: Am Dienstag, 3. Juli 2007 14:57 schrieb Matt Bowen: > Hi Stephen > > I'm in the same place as Hermann -- I've followed formdemo's message > package as closely as I can and made an object in debug mode, but when I > try to view or edit it, zope says it can't find index.html or edit.html. At > some point I realized that I was retyping code I had previously deleted and > was thus going in circles, so any help would be deeply appreciated. I'll > admit now that I'm pretty new to zope 3 and am trying to work both from > your examples and doctests and Philipp's book, so I may be muddled in more > than one place. > > On 6/19/07, Stephan Richter <[EMAIL PROTECTED]> wrote: > > Are you sure your skin has the correct layer in it? Have you looked at > > the Hello World example in z3c.formdemo? > > Could you explain this a little more? I have declared a layer as follows: > class IMovingTargetBrowserLayer(IFormLayer, IPageletBrowserLayer): > """The moving target browser skin layer""" > > and registered it: > > interface="movingtarget.layer.IMovingTargetBrowserLayer" > type="zope.publisher.interfaces.browser.IBrowserSkinType" > name="MovingTargetLayer" > /> > > Then I have a browser skin: > > from z3c.formui import interfaces > from movingtarget.layer import IMovingTargetBrowserLayer > > class IMovingTargetBrowserSkin(interfaces.IDivFormLayer, > IMovingTargetBrowserLayer): > """The Moving Target Browser skin""" > > which I register: > > interface="movingtarget.skin.browserskin.IMovingTargetBrowserSkin" > type="zope.publisher.interfaces.browser.IBrowserSkinType" > name="MovingTargetBrowser" > /> Hmmm, silly question: Are you including the ++skin++ attribute in the URL? So in your case it should be something like: http://localhost:8080/++skin++MovingTargetBrowser/MyNextActionObject/edit.html Regards, Hermann -- [EMAIL PROTECTED] GPG key ID: 299893C7 (on keyservers) FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7 ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] z3c.form and subforms in an AddForm?
Hi Stephen I'm in the same place as Hermann -- I've followed formdemo's message package as closely as I can and made an object in debug mode, but when I try to view or edit it, zope says it can't find index.html or edit.html. At some point I realized that I was retyping code I had previously deleted and was thus going in circles, so any help would be deeply appreciated. I'll admit now that I'm pretty new to zope 3 and am trying to work both from your examples and doctests and Philipp's book, so I may be muddled in more than one place. On 6/19/07, Stephan Richter <[EMAIL PROTECTED]> wrote: Are you sure your skin has the correct layer in it? Have you looked at the Hello World example in z3c.formdemo? Could you explain this a little more? I have declared a layer as follows: from z3c.form.interfaces import IFormLayer from z3c.layer.pagelet import IPageletBrowserLayer class IMovingTargetBrowserLayer(IFormLayer, IPageletBrowserLayer): """The moving target browser skin layer""" and registered it: Then I have a browser skin: from z3c.formui import interfaces from movingtarget.layer import IMovingTargetBrowserLayer class IMovingTargetBrowserSkin(interfaces.IDivFormLayer, IMovingTargetBrowserLayer): """The Moving Target Browser skin""" which I register: I have very simple edit and display classes: class NextActionEditForm(form.EditForm, layout.FormLayoutSupport): """A simple edit form for Next Actions""" label = u"Next Action Edit Form" fields = field.Fields(INextAction) class NextActionDisplayForm(form.DisplayForm, layout.FormLayoutSupport): """The display form for NextActions""" fields = field.Fields(INextAction) which I *think* I've registered edit and displays view with the following: But when I click on the name of my interpreter-made object, I get a 404. Anything obvious I'm missing? Thank you, Matt ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users