[Zope] Create object from path

Andreas Jung Andreas Jung <andreas@andreas-jung.com>
Tue, 17 Jun 2003 21:25:46 +0200


Do you want to create an object or retrieve an object by path.
Your idea below is odd since you do not specify what what
kind of object to be created. In general you need to create
an object and add this object to a container using
container._setOb() or container._setObject(). There is
also another approach using factories. Google for details.

-aj

--On Dienstag, 17. Juni 2003 12:17 Uhr -0700 Robert Jean 
<robertjean2@yahoo.com> wrote:

> Hello,
>
> I want to build an object from its path (string).
> In pseudo-code, it would be something like that:
>
> obj = makeObject('/mySite/news/news06172003')
> print obj.getId()
>
> ... assuming that news06172003 is a document located
> in /mySite/news.
>
> How do I achieve that in Python, DTML and/or ZPT?
>
> Your help is much appreciated,
> Robert
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )