ich versuche mich gerade in Zope3 einzuarbeiten.
Habe mal versucht das ZopeX3 Programmer Tutorial durchzuarbeiten und bin auf einige Probleme gestossen.
http://dev.zope.org/Wikis/DevSite/Proje ... torial.pdf
Ich habe eine Class Buddy im Module bubby.py:
Code: Alles auswählen
import persistent
import zope.interface
from buddydemo.interfaces import IBuddy
class Buddy(persistent.Persistent):
"""Buddy information"""
zope.interface.implements(IBuddy)
def __init__(self, first="", last="", email="",
address="", pc=""):
self.first=first
self.last=last
self.email=email
self.address=address
self.postal_code=pc
def name(self):
return "%s %s" % (self.first, self.last)
Code: Alles auswählen
import re
import zope.interface
from zope.schema import Text, TextLine
from zope.i18nmessageid import MessageIDFactory
_ = MessageIDFactory("buddydemo")
class IBuddy(zope.interface.Interface):
"""Provides access to buddy data"""
first = TextLine(title=_("First name"))
last = TextLine(title=_("Last name"))
email = TextLine(title=_("email"))
address = TextLine(title=_("Address"))
postal_code = TextLine(title=_("Postal Code"),
constraint=re.compile("\d{5,5}").match)
def name():
"""Returns the buddys name."""
Code: Alles auswählen
<configure
xmlns='http://namespaces.zope.org/zope'
xmlns:browser='http://namespaces.zope.org/browser'
i18n_domain='buddydemo'>
<content class=".buddy.Buddy">
<require
permission="zope.View"
interface=".interfaces.IBuddy"
/>
</content>
<browser:addMenuItem
class=".buddy.Buddy"
title="Buddy"
permission="zope.ManageContent"
/>
<browser:page
for="buddydemo.interfaces.IBuddy"
name="index.html"
template="info.pt"
permission="zope.View"
menu="zmi_views" title="View">
</browser:page>
<browser:editform
schema="buddydemo.interfaces.IBuddy"
name="edit.html"
permission="zope.View"
menu="zmi_views" title="Edit" />
</configure>
Das Log sagt:
Code: Alles auswählen
ForbiddenAttribute: ('first', <buddydemo.buddy.Buddy object at 0x022244B0>)
Die DocFileSuite habe ich irgendwie auch nicht lauffähig gebracht.

Meine Zope Instanz liegt unter c:\zopeinstance und ich starte im verzeichnis c:\zopeinstance\lib\python folgenden command:
Code: Alles auswählen
python c:\python\lib\site-packages\zope\app\tests\test.py -s buddydemo
Ist mir ein Rätsel wie er auf den Packagenamen ydemo (es müsste buddydemo heissen) kommt....
