[Zope-dev] urg

Tom Deprez tom.deprez@uz.kuleuven.ac.be
Tue, 07 Mar 2000 18:01:44 +0100


>> Please, tell me where my braintumor is messing my clear thinking.
>
>Its the idea that on your first try working with classes in python,
>Zope, subclassing, etc. you could get it to work :)

I'm afraid you're right on this. However, this is the way I learned all the
other languages. :-)

>Maybe its the idea of "a property" that is messing you up. (I'm working
>with the same parent-parent-etc. thing.)
>
>The idea I am using is to store (in the catalog) the result of a
>external method that returns the parent-parent string. This way any
>cut-paste-move that updates the catalog, gets the new values.
>
>something simple (I'm no python expert... change as needed, meta_type
>typing etc.)
>
>"parents.py":
>from string import split
>
>def parents(self):
>    parentsnames = split(self.absolute_url(),'/')[3:-1]
>   # [3:-1] removes the host info or use something different to split
>on..
>   # the -1 removes the last element, i.e. self.id
>    return parentsnames
>
>
>I use something similiar to store the parents in my Zcatalogs.
>
>You may need to resolve_url to get the objects and do your checking,
>etc..

aha! Looks like this is indeed another way of looking into the problem.
However, I don't understand it fully. Where, when, how do you call this
external method ie parents(self)?

Regards, Tom.