[Grok-dev] Having objects appear in more than one place in the Application Hierarchy

Brandon Craig Rhodes brandon at rhodesmill.org
Sun Nov 25 21:20:18 EST 2007


"Ali Afshar" <aafshar at gmail.com> writes:

> I have an application that has Courses (imagine e-learning), and
> each course contains Lessons. Now I want to be able to share these
> lessons amongst different courses, but I am not sure what the best
> way to proceed is.

Ali's question brings up excellent issues that we should cover in a
mini-tutorial.  The simple Grok and Zope examples I've seen show
objects singly-contained inside of ZODB containers, which - among
other things - makes it obvious what to expect when one calls
view.url() on them.  But what if you want an object to be referenced
from other locations?  I've taken a quick look over PvW's book and
can't easily find the answer.  Is the rule that (as a wild guess) a
ZODB object can only be in one container, and so other references have
to be from attributes instead of from a container's list of contents?

-- 
Brandon Craig Rhodes   brandon at rhodesmill.org   http://rhodesmill.org/brandon


More information about the Grok-dev mailing list