[Zope3-Users] PyWebOff
Jeff Shell
eucci.group at gmail.com
Mon Mar 20 13:43:18 EST 2006
Argh. Darn that user group meeting being down in Utah Valley. Don't
they consider the fact that there may be Utahn's who still try to
cling to a car-free urban lifestyle notion (especially when they live
and work on the same block)? :) Tell them to come up by my house.
Terrific restaurants, delis, italian markets, etc. Some of the best
Thai food in the city...
Anyways, it's too late to help you for the user group meeting in
question, but I'd like to take this on as a personal little challenge,
seeing if I can come up with a more interesting and "pleasing to the
Python developer" solution. Maybe you can show it next month as an
alternate option?
On 3/3/06, Shane Hathaway <shane at hathawaymix.org> wrote:
> Hello,
>
> I've been assigned to present Zope in a local upcoming Python user group
> meeting. As part of the assignment, I'm supposed to solve the PyWebOff
> challenge using Zope:
>
> http://pyre.third-bit.com/pyweb/challenge.html
>
> I'd like to do this using Zope 3. However, I'm really struggling. I
> feel like I must be using Zope 3 in a really dumb way, because the code
> so far is highly repetitive, completely dependent on Zope, and more XML
> than Python. This is not going to go over well in the presentation.
>
> Can anyone tell me how to do this better with Zope 3? Maybe my Zope 2
> experience is preventing me from seeing something obvious. I've
> attached the __init__.py and configure.zcml that I created in a package
> called "challenge".
>
> Shane
>
>
> <configure xmlns="http://namespaces.zope.org/zope"
> xmlns:browser="http://namespaces.zope.org/browser">
>
> <content class=".Book">
> <require
> permission="zope.View"
> interface=".IBook"
> />
> <require
> permission="zope.ManageContent"
> set_schema=".IBook"
> />
> </content>
>
> <content class=".Loan">
> <require
> permission="zope.ManageContent"
> interface=".ILoan"
> />
> <require
> permission="zope.ManageContent"
> set_schema=".ILoan"
> />
> </content>
>
> <content class=".Library">
> <require
> permission="zope.ManageContent"
> interface=".ILibrary"
> />
> <require
> permission="zope.ManageContent"
> set_schema=".ILibrary"
> />
> </content>
>
> <browser:addform
> name="addlibrary"
> schema=".ILibrary"
> content_factory=".Library"
> permission="zope.ManageContent"
> />
>
> <browser:addMenuItem
> class=".Library"
> permission="zope.ManageContent"
> view="addlibrary"
> title="Library"
> />
>
> <browser:containerViews
> for=".ILibrary"
> index="zope.View"
> contents="zope.View"
> add="zope.ManageContent"
> />
>
> <browser:addform
> name="addbook"
> schema=".IBook"
> content_factory=".Book"
> permission="zope.ManageContent"
> />
>
> <browser:addMenuItem
> class=".Book"
> permission="zope.ManageContent"
> view="addbook"
> title="Book"
> />
>
> <browser:editform
> schema=".IBook"
> permission="zope.ManageContent"
> menu="zmi_views"
> title="Edit"
> name="edit"
> />
>
> <browser:addform
> name="addloan"
> schema=".ILoan"
> content_factory=".Loan"
> permission="zope.ManageContent"
> />
>
> <browser:addMenuItem
> class=".Loan"
> permission="zope.ManageContent"
> view="addloan"
> title="Loan"
> />
>
> <browser:editform
> schema=".ILoan"
> permission="zope.ManageContent"
> menu="zmi_views"
> title="Edit"
> name="edit"
> />
>
> </configure>
>
>
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
>
>
>
>
--
Jeff Shell
More information about the Zope3-users
mailing list