[Zope3-dev] Newbie questions.

Joao Paulo Liberato jpliberato at horizon.com.br
Fri Jun 25 15:15:12 EDT 2004


Hello guys,

I have some newbie questions about ZopeX3.  I've already read the Zope3 
book, implemented the examples, and now I'm trying to implement a very 
basic model, just to get used with the environment.  I'm having some 
trouble with relationships between interfaces, I'm not sure how to make 
it work with Zope3.
For instance, let's pretend I have two interfaces.  IState, that 
represents a state, and ICity, that represents a city.  They have a 
1-to-many relationship, where a state can contain any number of cities, 
and a city belongs to only one state (very basic, like I said).
Accordingly, I'd like to have an attribute at ICity called state, that 
is a IState.  But when I'm adding a new city, how can I make a lookup of 
the available states?  I'd like to enforce that the city must belong to 
one of the available states.  How can one enforce that kind of requisite 
in Zope3?  How can I make a list of the available states?
I think I could model IState subclassing IContainer, and put the cities 
inside each state container.  It would solve the problem for that simple 
example, but for a more complex case, I don't think that would be the 
best way to go.  I think Zope3 is a platform suitable for any kind of 
applications, not just web-centric applications, I just need to get used 
to it.  Any help is appreciated.

Best regards,

JP Liberato.


More information about the Zope3-dev mailing list