[Zope3-dev] i18n breaks Schema
Gregoire Weber
gregweb@gmx.ch
Wed, 26 Mar 2003 15:04:12 +0100
Hi all,
>Do you all get this error? Which version of Python are you using? It
>definitely worked for Jim yesterday.
The others work on older checkouts.
The ones who instantiate NewsItems work on a checkout of yesterday
(exactly 2003-03-25 19:05 CET) and the problem has gone.
The problem is that there are some later checkins from Tres into
the core we need also.
The problem appears while adding a News Item. Exactly after pressing
'Return' after having entered a name.
The code invoked by this action is straight forward.
>(BTW, the error is caused by gettext, even though I know they are going to
>have a fishy isinstanceof() call somewhere there... I will look into it
>later, but try it with the latest Python 2.2 version and Python 2.3 CVS.
We all work with python2.2
Please have a look.
Gregoire
---------- Code snippets ----------
<http://cvs.zope.org/Products3/NewsSite/NewsItem/interfaces.py>
from zope.interface import Interface
from zope.schema import Text, TextLine, Datetime
class INewsItem(Interface):
"Describes the representation of a news item."
title =3D TextLine(title=3Du"News Title")
lead =3D Text(title=3Du"News Lead")
newsbody =3D Text(title=3Du"News Message")
effective =3D Datetime(title=3Du"Effective")
expires =3D Datetime(title=3Du"Expires")
<http://cvs.zope.org/Products3/NewsSite/NewsItem/configure.zcml>
<!-- stripped -->
<browser:addform
schema=3D".interfaces.INewsItem"
label=3D"Add News Item"
content_factory=3D".news.NewsItem"
arguments=3D"newsbody"
name=3D"AddNewsItem"
menu=3D"add_news" title=3D"News Item"
permission=3D"zopeproducts.NewsSite.NewsItem.ManageNewsItems" />
<!-- stripped -->
<http://cvs.zope.org/Products3/NewsSite/NewsItem/news.py>
import persistence
from zope.component import getAdapter
from zope.app.interfaces.dublincore import IZopeDublinCore
from interfaces import INewsItem
class NewsItem(persistence.Persistent):
"""News Item.
"""
__implements__ =3D INewsItem
def __init__(self, newsbody=3D""):
# XXX We don't know why setting newsbody=3Du"" does
# not save the newsbody value typed in in the
# form.
self.newsbody =3D newsbody
# etc.
_____________________________________
Gr=E9goire Weber
mailto:gregoire.weber@switzerland.org