[Zope3-Users] Re: [Zope3-dev] Navigating between containers (sort of basic ZPT question).

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Nov 22 08:31:02 EST 2004


On Monday 15 November 2004 08:37, Luca Manini wrote:
> I'm quite new to Zope, my question is probably really 'basic'. I
> apologize if this is not the right ML to post to (just tell me a
> better one), but I'm interested in Zope 3 ONLY and this seems to be
> the only ML devoted to it.

We created zope3-users at zope.org for exactely this purpose.

> I've read the wonderfull ProgrammerTutorial (from Jim Fulton) [1] and
> the Zope-3-for-Zope-2-developers doc. I've also done my home work with
> buddydemo. Nevertheless ... my problem is:
>
> 1) I've two content classes (User, Group) and corresponding
>    constrained containers (UserFolder, GroupFolder).
>
> 2) I've working 'listing' views for both.
>
> 3) I want to be able to jump from one list to the other, for example:
>    having the 'gid' cell of a user's row being a href to the
>    corresponding Group view (like ..../users/staff), or to a filtered
>    list of other users in that group.
>
> I have not found any example of this (very basic and common)
> operation: it took me ages to find oput about the @@absolute_url view.
> The 'mechanics' I need to learn to do is:
>
> 1) managing paths (like getting absolute_url of a context and
>    splitting joining it);
>
> 2) be able to get a container from 'a know location' (may be something
>    like site_root/users) or from acquisition (the first - or topmost -
>    container with some interface abowe the current user).
>
> 3) how to get (from Python code) an object from an URL.
>
> Then I hope I'll be able to put that in the framework like making an
> adapter AllTheUSerInTheSameGroup from IUser to IGroupFolder that uses
> a utility FilteredGroupFolderFromGid.

The best would be to utilize the UniqueId utility. Given an uid, this utility 
will return the Python object to you. You can then use absolute_url to get 
its path.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list