[Zope3-dev] RFC: View Methods as Views
Tim Hoffman
timhoffman@cams.wa.gov.au
10 May 2002 12:14:38 +0800
Hi Jim
Wouldn't the second option be more future proof, from a design point of
view
<browser:view
for=".IContactEdit."
factory=".IContactInfoView.">
permission_id=".Contacts.ManageContacts"
>
<page name="editForm.html" method="index" />
<page name="edit.html" method="edit" />
</browser:view>
I can imagine over time you may want to add further directives to each
of the view methods in the zcml file, using the second method each
view has an explicit element, whereas to add additional view attributes
you would have to add new tags.
e.g over riding the general browser:view permission with a specific view
permission (OK maybe you may never want to do this, but just as an
example)
<browser:view
for=".IContactEdit."
factory=".IContactInfoView.">
permission_id=".Contacts.ManageContacts"
>
<page name="editForm.html" method="index" />
<page name="edit.html" method="edit"
permission_id=".Contacts.SomeSpecialPermission"/>
</browser:view>
my 2c worth
Tim
On Wed, 2002-05-08 at 23:33, Jim Fulton wrote:
>
> I posted a proposal at:
>
> http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ViewMethodsAsViews
>
> for allowing a views to add their methods to the view namespace. This
> is to avoid relative URLs like: '../edit/' when generating cross-view links,
> which really bugs some folks a lot.
>
> I'd love to get some comments on this, including alternate spellings.
>
> Jim
>
> --
> Jim Fulton mailto:jim@zope.com Python Powered!
> CTO (888) 344-4332 http://www.python.org
> Zope Corporation http://www.zope.com http://www.zope.org
>
>
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope3-dev