[Zope3-Users] Re: Newbie relationship question
Carlo Cardelli
ccardelli at iv-srl.it
Wed Sep 6 09:58:52 EDT 2006
Stephan Richter wrote:
> On Thursday 27 July 2006 05:17, Carlo Cardelli wrote:
>
>>- how do I get all my Customers instances? The Customer class is marked
>>as 'Persistent' and 'IContentType'.
>
>
> You have several choices:
>
> 1. Register your customer object as a utility and then do utility lookups. In
> this case you can reuse code in zope.app.component.vocabulary.
> 2. You probably have a convention where to find customers, like a
> "CustomerContainer". You can setup your application to easily look up this
> container to get the entries.
Thank you for your answer. In the meantime I made some progress with
containers.
In your opinion, which of these 2 options suits best for a large number
of objects (say, about 100,000 customers)?
About vocabularies: In another post you say you'd rather use them
instead of sources. As far as I can see, queryable sources seem the main
choice for management of large collections. Example: a user wants to
browse a list of all Customers beginning with "a"; I cannot fill the
HTML page with about 5000 entries, but have to manage "chunks" of
objects in some way. Hence a queryable object is needed.
Am I wrong? Is there a way to tweak vocabularies to support such cases?
Could anyone provide an example of a similar implementation? Note that I
have to use a Relational db, so if I understand well I cannot use
catalogs or similar.
>
>>A somewhat derived question:
>>- Given a certain Invoice, how do I use the 'reference' to the Customer
>>Object to access the Customer of the Invoice?
>
>
Re-reading this now, this was really a silly question...
Thank you again.
Carlo Cardelli.
More information about the Zope3-users
mailing list