Is there an equivalent to a python dictionary, but in a zope object ?? -- __o _ \<_ (_)/(_) Saludos de Julián EA4ACL -.-
Hi! Maybe, i didn't understand your question but, a Zope object has his own dictionary. Regards, Paula Mangas On Wed, 9 Jan 2002, Julián Muñoz Domínguez wrote:
Is there an equivalent to a python dictionary, but in a zope object ??
Hum, a Zope object has his own dictionary ??? How do I store an element in it ? container.foldername['test']={'a':'123', 'b':[1,2,3]} works from a python script ? On Wed, 9 Jan 2002, Paula Mangas wrote:
Hi!
Maybe, i didn't understand your question but, a Zope object has his own dictionary.
Regards, Paula Mangas
On Wed, 9 Jan 2002, Julián Muñoz Domínguez wrote:
Is there an equivalent to a python dictionary, but in a zope object ??
-- __o _ \<_ (_)/(_) Saludos de Julián EA4ACL -.-
Supposing that container is an instance of one zope product, called X... foldername is a dictionary defined on *__init__* method (in product X)... def __init__(self): "init method" ( ... ) foldername = {} ( ... ) so, container.foldername['test'] = {} container.foldername['test']['a'] ='123' container.foldername['test']['b'] = [1, 2, 3] works. And your container object has a dictionary like this: {'test': {'a': '123', 'b': [1, 2, 3]}, (...)} I hope this can help, Paula Mangas On Wed, 9 Jan 2002, Julián Muñoz Domínguez wrote:
Hum, a Zope object has his own dictionary ??? How do I store an element in it ?
container.foldername['test']={'a':'123', 'b':[1,2,3]}
works from a python script ?
On Wed, 9 Jan 2002, Paula Mangas wrote:
Hi!
Maybe, i didn't understand your question but, a Zope object has his own dictionary.
Regards, Paula Mangas
On Wed, 9 Jan 2002, Julián Muñoz Domínguez wrote:
Is there an equivalent to a python dictionary, but in a zope object ??
=?ISO-8859-1?Q?Juli=E1n_Mu=F1oz_Dom=EDnguez?= writes:
Hum, a Zope object has his own dictionary ??? How do I store an element in it ?
container.foldername['test']={'a':'123', 'b':[1,2,3]}
works from a python script ? Probably not -- because of security restrictions:
o.x= dict would work in an External Method (or a file system based product method) when "o" is an object, "x" a (attribute) name and "dict" a dictionary. However, you need to be careful, when you later modify the dictionary. You may foul Zope's persistence machinery and your modifications may get lost. Dieter
participants (3)
-
Dieter Maurer -
Julián Muñoz Domínguez -
Paula Mangas