[Zope-dev] Getting parent within ZClass hierarchy

2001-02-09 Thread Arno Gross

Easy question, but I couldn't find the answer.
How can I access the id (or title) of the parent 
containing my current object?

E.g.

NewsContainer
  |---NewsCategory  ( ZClass - ObjectManager)
 |---NewsItem (ZClass - CatalogAware)

I'm looking for a method (Python script) in NewsItem, which give me the id or
title of its parent.

Thanks
   Arno Gross, email: [EMAIL PROTECTED]

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] Getting parent within ZClass hierarchy

2001-02-09 Thread Steve Alexander

Arno Gross wrote:

 Easy question, but I couldn't find the answer.
 How can I access the id (or title) of the parent 
 containing my current object?
 
 E.g.
 
 NewsContainer
   |---NewsCategory  ( ZClass - ObjectManager)
  |---NewsItem (ZClass - CatalogAware)
 
 I'm looking for a method (Python script) in NewsItem, which give me the id or
 title of its parent.

From DTML:

dtml-with "aq_parent"
  dtml-var title_or_id
/dtml-with
 From a PythonScript:

container.aq_parent.id

(if the PythonScript is a member of the NewsItem class)

context.aq_parent.if

(if the PythonScript is acquired from elsewhere)

This isn't really a zope-dev kind of question, as it is more about using 
Zope in a basic kind of way. You should ask questions like this on 
[EMAIL PROTECTED] instead.

--
Steve Alexander
Software Engineer
Cat-Box limited
http://www.cat-box.net


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )