Re: [Zope-dev] manage_options in 2.3
"Chris Withers" <chrisw@nipltd.com> wrote:
ActivePython 2.0, build 202 (ActiveState Tool Corp.) based on Python 2.0 (#8, Oct 19 2000, 11:30:05) [MSC Type "copyright", "credits" or "license" for more in
a = ('a','b','c','d') print type(a) <type 'tuple'> b = a[1:] print b ('b', 'c', 'd')
Hmmm... does 'normal' python work like that too? Probably...
$ python Python 1.5.2 (#1, Feb 1 2000, 16:32:16) [GCC egcs-2.91.66 19990314/Linux (egcs- on linux-i386 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
a = ( 1,2,3,4 ) a (1, 2, 3, 4) a[ 1:3 ] (2, 3)
Ah well, you learn something new every day :-)
Only on the good days -- the bad ones you spend in meetings. :) Tres. -- =============================================================== Tres Seaver tseaver@digicool.com Digital Creations "Zope Dealers" http://www.zope.org
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: arno.gross@consotec.de
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 zope@zope.org instead. -- Steve Alexander Software Engineer Cat-Box limited http://www.cat-box.net
participants (3)
-
Arno Gross -
Steve Alexander -
Tres Seaver