On Friday 15 June 2007 13:52, gnosis wrote:
> browser/restaurant.py
>
> class RestaurantAddForm(AddFormLayoutSupport, form.AddForm):
>     """Add form"""
...

You do not need the layout support here, since this view does not render as a 
standalone Web page.

...
>     def update(self):
>         self.address = AddressAddForm(self.context.address, self.request)
> ## <---- Problem area
>         self.address.update()
>         super(RestaurantAddForm, self).update()
...

Simply pass in self.context.

> browser/address.py
...
Looks good.


> browser/configure.zcml
...
>    <!-- Address Add Form -->
>   <z3c:pagelet
>     name="addAddress.html"
>     for="metrod.restaurant.interfaces.IAddress"
>     class=".address.AddressAddForm"
>     layer="metrod.app.layer.IMetroDBrowserLayer"
>     permission="zope.Public" />
...

This directive is not needed, since you never render it as a standalone Web 
page. You already instantiate the view within the person view's update() 
method.

BTW, you forgot the most interesting part. The templates. In the person view 
template you have to somewhere do this or something similar:

<div tal:replace="structure view/address/render" />

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

Reply via email to