How About Storing Python Data Structures Directly in ZODB?
Is there a way to store, e.g., a Python dictionary object *directly* in the ZODB either as a DTML Document/Method or as a File Object, e.g.? I *think* it would be possible to use a string to store the dictionary in a DTML Method and then do an eval() or exec() on the string depending on the context, but I'm not really sure. Still learning.
Sure, but not via DTML or any other through the web script. This is disallowed by the security machinery. You'll need to use an external method or a Python product. See http://www.amk.ca/zodb/guide/ for more details. On Sat, 2002-05-18 at 19:38, Dan Shafer wrote:
Is there a way to store, e.g., a Python dictionary object *directly* in the ZODB either as a DTML Document/Method or as a File Object, e.g.?
I *think* it would be possible to use a string to store the dictionary in a DTML Method and then do an eval() or exec() on the string depending on the context, but I'm not really sure.
Still learning.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Makes sense, Chris. Thanks for the quick answer. At 07:44 PM 5/18/2002 -0400, Chris McDonough wrote:
Sure, but not via DTML or any other through the web script. This is disallowed by the security machinery. You'll need to use an external method or a Python product.
See http://www.amk.ca/zodb/guide/ for more details.
On Sat, 2002-05-18 at 19:38, Dan Shafer wrote:
Is there a way to store, e.g., a Python dictionary object *directly* in the ZODB either as a DTML Document/Method or as a File Object, e.g.?
I *think* it would be possible to use a string to store the dictionary in a DTML Method and then do an eval() or exec() on the string depending on the context, but I'm not really sure.
Still learning.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Chris McDonough -
Dan Shafer