is it possible to get a file from its id?
if I have done files = container.Entries.objectIds('File') instead of files = container.Entries.objectValues('File') how can I later get the file from its ID? _______________________________________________________________ Yahoo! Messenger Nueva versión: Webcam, voz, y mucho más ¡Gratis! Descárgalo ya desde http://messenger.yahoo.es
every of object in your list files has a method getId() that returns the ID of the object. For further details check the Zope Book. -aj --On Dienstag, 22. Oktober 2002 15:15 +0200 juan garcia <garcia_arboleya@yahoo.es> wrote:
if I have done
files = container.Entries.objectIds('File')
instead of
files = container.Entries.objectValues('File')
how can I later get the file from its ID?
_______________________________________________________________ Yahoo! Messenger Nueva versión: Webcam, voz, y mucho más ¡Gratis! Descárgalo ya desde http://messenger.yahoo.es
_______________________________________________ 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 )
--------------------------------------------------------------------- - Andreas Jung http://www.andreas-jung.com - - EMail: andreas at andreas-jung.com - - "Life is too short to (re)write parsers" - ---------------------------------------------------------------------
in Script (Python): id = "my_file_name" o = getattr(context, id) this assumes that the file "my_file_name" can be acquired from context juan garcia wrote:
if I have done
files = container.Entries.objectIds('File')
instead of
files = container.Entries.objectValues('File')
how can I later get the file from its ID?
_______________________________________________________________ Yahoo! Messenger Nueva versión: Webcam, voz, y mucho más ¡Gratis! Descárgalo ya desde http://messenger.yahoo.es
_______________________________________________ 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 (3)
-
Andreas Jung -
juan garcia -
peter sabaini