On Thursday 09 June 2005 12:44, Florian Lindner wrote:
> I try to use the User Preference API.
> I've defined a Interface:
> class IUserSettings(Interface):
> email = TextLine(
> title = u"E-mail Address")
> and registered it in my configure.zcml:
> title="Basic User Settings"
> First question: What happens if two configure.zcml files register a
> preference group with the same name?
You should get a conflict error, since preference groups are simply utilities.
> When I go to http://localhost:8080/++preferences++ I see a page which -
> amoung others - displays my preferencce group.
> http://localhost:8080/++preferences++/UserSettings displays only my group.
> I try to use the value of email in a ZPT:
> E-Mail: <span tal:replace="++preferences++/UserSettings/email" />
> E-Mail: <span tal:replace="++preferences++UserSettings/email" />
> both give this traceback:
> PTRuntimeError: ['Compilation failed', 'zope.tal.taldefs.TALError: Invalid
> variable name "email" in expression \'++preferences++UserSettings/email\',
> at line 6, column 15']
> What is wrong there?
This is not a preferences error, but a pagetemplate one. I have no clue what
could have gone wrong here. Can you try a different name? Maybe something
like `email1`? I suspect a clash of variable names.
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-users mailing list