каталог helloworld:
__init__.py
helloworld.py
from zope.interface import implements
from zope.container.btree import BTreeContainer
from interfaces import IHello
class Hello(BTreeContainer):
implements(IHello)
hello = u''
interfaces.py
from zope.container.interfaces import IContainer
from zope.schema import TextLine, Text, Int
class IHello(IContainer):
hello = TextLine(
title=u"name",
default=u"",
required=False)
configure.zcml
<configure xmlns="http://namespaces.zope.org/zope">
<interface
interface=".interfaces.IHello"
type="zope.app.content.interfaces.IContentType"/>
<class class=".helloworld.Hello">
<require
interface=".interfaces.IHello"
permission="zope.Public"
/>
<require
set_schema=".interfaces.IHello"
permission="zope.Public"
/>
</class>
<include package=".browser" />
</configure>
каталог browser:
__init__.py
helloworld.py:
from uralexpont.content.helloworld.helloworld import Hello
from zope.browserpage import ViewPageTemplateFile
from zope.container.interfaces import INameChooser
class Hello(object):
template = ViewPageTemplateFile('hello.pt')
def __call__(self):
return self.template()
class HelloAdd(object):
def __call__(self):
hello = Hello()
#подбираем имя
namechooser = INameChooser(self.context)
number = namechooser.chooseName('hello', hello)
self.context[number] = hello
return 'done'
hello.pt
<html metal:use-macro="context/@@macro_main/master">
<metal:fill fill-slot="body">
<h3>hello</h3>
</metal:fill>
</html>
configure.zcml:
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser">
<browser:page
for="..interfaces.IHello"
name="index"
permission="zope.Public"
class=".helloworld.Hello"
layer="uralexpont.skin.interfaces.IUENTLayer"
/>
<browser:page
for="*"
name="add_hello"
permission="zope.Public"
class=".helloworld.HelloAdd"
layer="uralexpont.skin.interfaces.IUENTLayer"
/>
</configure>
добавляем, заходим, получаем
ComponentLookupError: (“Couldn't find default view name”, None, <zope.publisher.browser.BrowserRequest instance URL=
http://127.0.0.1:8080/++skin++UENTAdminSkin/legislation/hello>)
Нет интерфейсов на объекте.
И слов тоже больше нет. Одни эмоции..
Помогите, умные люди ;)
Может питон с ума сошёл?
ББ уже переустанавливал, безуспешно..