Re: [Zope3-Users] Still trying am to build an EditForm
Hi Florian, I have been playing with your example, try this: download http://user.cs.tu-berlin.de/~reuleaux/blogs.tgz unpack and cd into blogs edit buildout.cfg as you see fit: especially the eggs-directory should be changed, right now: /home/reuleaux/z3eggs $ python bootstrap.py $ ./bin/buildout $ ./bin/instance start|stop|restart|debug then goto: localhost:8080 you can e. g. add a folder there, say foo (but you don't have to) the use the My skin: http://localhost:8080/++skin++My/foo there you can add blog entries, edit them, see the list of all entries, there is some navigation bar on the left. Basically this is a mixture of * the addressbook-example of formdemo * your interface defs * Baiju's blog for zc.buildout example * some of my own stuff, that I learnt from z3c.form so far some points to note: * somewhere in a template I was having difficulties with widget/content -> therefore changed to cntnt * there are some Makefiles in there that allow you to clean up - in the current folder with: make clean - recursively with: make rclean * the example really needs some cleanup - lot's of pkgs not needed - forms could certainly be used smarter: e g. I wanted a DisplayForm with a change button -> I used form.Form however it works for me. hope this helps. -Andreas On Sun, Sep 02, 2007 at 09:39:56PM +0200, Florian Lindner wrote: > Hello, > I am still trying to build an EditForm using z3c.form. Since my previous > thread is rather old I dare to open a new one. > > I've tried a number of variations and will post the one which is the closest > to the example. > > This is the interface: > > class IBlogEntry(IContainer): > """Interface for blog entry objects.""" > contains(IBlogComment) > > title = TextLine( > title = _(u"Blog entry title"), > description = _(u"Blog entry title."), > default = u"", > required = True) > > content = Text( > title = _(u"Blog entry content"), > description = _(u"Blog entry content."), > default = u"", > required = True) > > inputType = Choice( > title = _(u"Type of input"), > description = _(u"Specify the input type"), > required = True, > default = u"reStructeredText", > values = [u"reStructeredText", u"HTML"] ) > > The view is configured like that: > > name="EditEntry.html" > for="..interfaces.IBlogEntry" > class=".views.EditEntry" > permission="Blog.EditEntry" > layer="Blog.interfaces.IBlogLayer" > /> > > The code in .views.EditEntry is: > > class EditEntry(layout.FormLayoutSupport, form.EditForm): > fields = field.Fields(IBlogEntry).select("title", "content") > > The layer is registered like that: > > interface=".interfaces.IBlogLayer" > name="BlogSkin" > type="zope.publisher.interfaces.browser.IBrowserSkinType" > /> > > and > > class IBlogLayer(IFormLayer, IPageletBrowserLayer): > """Demo browser layer using div-form layout template.""" > > > Now I call the URL. > > http://localhost:8080/++skin++BlogSkin/Blog/2007_08_16_abc/EditEntry > > 2007_08_16_abc ist an BlogEntry object. > > Now there comes an "ComponentLookupError. A server error occurred. " up. > > Traceback (most recent call last): > Module zope.publisher.publish, line 133, in publish > result = publication.callObject(request, obj) > Module zope.app.publication.zopepublication, line 167, in callObject > return mapply(ob, request.getPositionalArguments(), request) > Module zope.publisher.publish, line 108, in mapply > return debug_call(obj, args) >- __traceback_info__: instance > at 0xa0248cc> > Module zope.publisher.publish, line 114, in debug_call > return obj(*args) > Module z3c.formui.layout, line 27, in __call__ > ILayoutTemplate) > Module zope.component._api, line 103, in getMultiAdapter > raise ComponentLookupError(objects, interface, name) > ComponentLookupError: ((, > URL=http://localhost:8080/++skin++BlogSkin/Blog/2007_08_16_abc/EditEntry.html>), > > , u'') > > > I have also tried some variations of the above like not using z3c:pagelet but > an normal page directive, registered it without an layer directive and so on. > > So please... whats wrong there? > > Thanks, > > Florian > ___ > Zope3-users mailing list > Zope3-users@zope.org > http://mail.zope.org/mailman/listinfo/zope3-users > > > !DSPAM:46db201184319549218874! ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Basic question about catalogs
Hello everybody, While figuring out catalogs in zope3 (3.3.1 on ubuntu 7.04), i ran into a problem. I think it is just a basic configuration thing, but I could not find what I'm doing wrong. In "/++etc++site/default/" I have added an IntIds and an Catalog (Both registered; without a name). Then I have added an FiledIndex in the Catalog for "zope.app.file.interfaces.IFile" with the attribute "contentType" marked as callable. After creating an file-object, the catalog still says in the advanced view, that 0 items were found. I thought one item (the file) should be registered. Am I missing an configurationdetail or somthing? Help would be great. Regards, Tobias ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Still trying am to build an EditForm
Hello, I am still trying to build an EditForm using z3c.form. Since my previous thread is rather old I dare to open a new one. I've tried a number of variations and will post the one which is the closest to the example. This is the interface: class IBlogEntry(IContainer): """Interface for blog entry objects.""" contains(IBlogComment) title = TextLine( title = _(u"Blog entry title"), description = _(u"Blog entry title."), default = u"", required = True) content = Text( title = _(u"Blog entry content"), description = _(u"Blog entry content."), default = u"", required = True) inputType = Choice( title = _(u"Type of input"), description = _(u"Specify the input type"), required = True, default = u"reStructeredText", values = [u"reStructeredText", u"HTML"] ) The view is configured like that: The code in .views.EditEntry is: class EditEntry(layout.FormLayoutSupport, form.EditForm): fields = field.Fields(IBlogEntry).select("title", "content") The layer is registered like that: and class IBlogLayer(IFormLayer, IPageletBrowserLayer): """Demo browser layer using div-form layout template.""" Now I call the URL. http://localhost:8080/++skin++BlogSkin/Blog/2007_08_16_abc/EditEntry 2007_08_16_abc ist an BlogEntry object. Now there comes an "ComponentLookupError. A server error occurred. " up. Traceback (most recent call last): Module zope.publisher.publish, line 133, in publish result = publication.callObject(request, obj) Module zope.app.publication.zopepublication, line 167, in callObject return mapply(ob, request.getPositionalArguments(), request) Module zope.publisher.publish, line 108, in mapply return debug_call(obj, args) - __traceback_info__: Module zope.publisher.publish, line 114, in debug_call return obj(*args) Module z3c.formui.layout, line 27, in __call__ ILayoutTemplate) Module zope.component._api, line 103, in getMultiAdapter raise ComponentLookupError(objects, interface, name) ComponentLookupError: ((, http://localhost:8080/++skin++BlogSkin/Blog/2007_08_16_abc/EditEntry.html>), , u'') I have also tried some variations of the above like not using z3c:pagelet but an normal page directive, registered it without an layer directive and so on. So please... whats wrong there? Thanks, Florian ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] z3c.form / TextLine-Schema in List-Schema
Hi list, z3c.form has a very generic, well approach - but at the moment it's to complicated to me. I have an interface defined like: 100 osList = List ( 101 title = _("operating systems"), 103 value_type = TextLine( 105 title = _("Operatingsystem"), 107 default = u"", 108 required = False), 109 required = False) [originally from http://trac.ict-ok.org/browser/trunk/org/ict_ok/components/host/interfaces.py ] when z3c.form will do his update, i'll get a ComponentLookupError: ( (, , http://localhost:8081/cc071bd954f8fd7b3fccf9fab2b1c7b58/add_host.html>), , u'') [full trace on http://paste.lisp.org/display/47105 ] ok, the problem is in getMultiAdapter() .. which does'n find the correct widget to render a TextLine into a List-HTML-Widget. (After hours of searching, i feel stupid ... but it's not rocket science, or?) Where and how such a widget must be registered and implemented? Does anyone have such an extension of the ze3.form-widgets or can tell me a kind of skeleton for this approach? Can we migrate code from zope.formlib to z3c.form? Any help would be appreciated. Markus ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: ZCML directives/InterfaceField?
Tnx, works like a charm. -aj --On 2. September 2007 13:08:57 +0200 Philipp von Weitershausen <[EMAIL PROTECTED]> wrote: Andreas Jung wrote: I need to write a custom ZCML directive that takes a list of interfaces - something like interfaces="Products.Foo.intefaces.IXXX, Products.Foo.interfaces.IYYY,..." We usually do it without the comma, just separated by whitespace. What is the recommended way to specify 'interfaces' within the schema definition (as InterfaceField or as TextLine)? InterfaceField did not work out-of-the-box complaining about a missing fromUnicode attribute. With a TextLine: what is the recommended way to get hold of the interface represented by a string? Is there some magic available somewhere in Zope 3? You won't ever have to resolve an interface name yourself. We have fields for this. Here's the field definition for your use case above (multiple interfaces separated by whitespace): interfaces = zope.configuration.fields.Tokens( title=..., description=..., required=True, value_type=zope.configuration.fields.GlobalInterface() ) -- http://worldcookery.com -- Professional Zope documentation and training -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK E-Publishing, Python, Zope & Plone development, Consulting pgppurezTFzlH.pgp Description: PGP signature ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: ZCML directives/InterfaceField?
Andreas Jung wrote: I need to write a custom ZCML directive that takes a list of interfaces - something like interfaces="Products.Foo.intefaces.IXXX, Products.Foo.interfaces.IYYY,..." We usually do it without the comma, just separated by whitespace. What is the recommended way to specify 'interfaces' within the schema definition (as InterfaceField or as TextLine)? InterfaceField did not work out-of-the-box complaining about a missing fromUnicode attribute. With a TextLine: what is the recommended way to get hold of the interface represented by a string? Is there some magic available somewhere in Zope 3? You won't ever have to resolve an interface name yourself. We have fields for this. Here's the field definition for your use case above (multiple interfaces separated by whitespace): interfaces = zope.configuration.fields.Tokens( title=..., description=..., required=True, value_type=zope.configuration.fields.GlobalInterface() ) -- http://worldcookery.com -- Professional Zope documentation and training ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] ZCML directives/InterfaceField?
Hi, I need to write a custom ZCML directive that takes a list of interfaces - something like interfaces="Products.Foo.intefaces.IXXX, Products.Foo.interfaces.IYYY,..." What is the recommended way to specify 'interfaces' within the schema definition (as InterfaceField or as TextLine)? InterfaceField did not work out-of-the-box complaining about a missing fromUnicode attribute. With a TextLine: what is the recommended way to get hold of the interface represented by a string? Is there some magic available somewhere in Zope 3? Tnx, Andreas -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK E-Publishing, Python, Zope & Plone development, Consulting pgpPN49rMojq4.pgp Description: PGP signature ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users