[Zope] Multilingual content class with LocalPropertyManager
Dragos Chirila
d.chirila at finsiel.ro
Tue Sep 6 04:25:22 EDT 2005
Hi
I want to build a multilingual content class with LocalPropertyManager
from the Localizer product. Also, my class extends the File class,
something like:
class MClass(LocalPropertyManager, File):
title = LocalProperty('title')
description = LocalProperty('description')
def __init__(self, id, title, description, file, precondition,
content_type, lang):
File.__dict__['__init__'](self, id, title, file, content_type,
precondition)
self._setLocalPropValue('title', lang, title)
self._setLocalPropValue('description', lang, description)
The problem is that everytime I call the title property it doesn't
return the LocalProperty 'title', but instead it returns the value
entered when the object was created.
From a ZPT, if lang is the current selected language and is 'en':
<span tal:replace="here/title" /> - don't get the correct value for the
selected language
<span tal:replace="python:here.getLocalProperty('title', lang)" /> -
correct value
Not event after editing the object properties, the 'title' value remains
the same: the value entered when the object was created.
I tried not to call the File constructor, but it doesn't work also. My
LocalProperty 'title' is somehow 'hidden'.
Could you please give me some indications about what am I doing wrong?
Is there another way to have a class like MClass?
Thanks a lot,
Dragos
More information about the Zope
mailing list