Am Samstag, 18. August 2007 schrieb Roger Ineichen:
> Hi Florian
>
> > Betreff: [Zope3-Users] Creating edit form with z3c.form
> >
> > Hello,
> > I try to create an edit form with z3c.form but it gives me an
> > system error only:
>
> [...]
>
> > ComponentLookupError:
> > ((<zope.app.publisher.browser.viewmeta.EditEntry object at
> > 0x9f6c68c>, <zope.publisher.browser.BrowserRequest instance
> > URL=http://localhost:8080/Blog/2007_08_16_abc/EditEntry.html>,
> > <Blog.blog.BlogEntry object at 0x9264d2c>), <InterfaceClass
> > z3c.form.interfaces.IWidgets>, u'')
>
> Try to find out which field doesn't have a widget. This is
> probably the __parent__ attribute.
>
> > My code looks like that:
> >
> > from z3c.form import form, field
> > from z3c.formui import layout
> >
> > class EditEntry(layout.FormLayoutSupport, form.EditForm):
> >     fields = field.Fields(IBlogEntry)
>
> Try to restrict your fields and find out which one does not
> have a widget with:
>
> fields = Fields(IBlogEntry).select('title', 'etc')

Hi!
I changed it to:

class EditEntry(layout.FormLayoutSupport, form.EditForm):
    fields = field.Fields(IBlogEntry).select("title", "content") 

but which doesn't change the error. This is the interface I get the fields 
from:

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"] )


Regards,

Florian
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to