On Jul 11, 2005, at 9:15 PM, Alec Munro wrote:

Sorry for the vague subject, but I wasn't sure how to summarize this.
It's not exactly a Zope question, but perhaps Zope has some tricks to
make it easier.

In a couple of situations, I want to have a collection of objects, and
allow users to select from those objects, and personalize them. The
way I was thinking about this was that I would have a second class of
objects that contained the additional properties as well as a property
containing the personalized object. This seems to be similar to the
way adapters operate. However, generally an adapter is created when
used, and discarded, correct? What is the recommended way to go about
this?

Assuming this is for authenticated users, you might want to look at zope/app/principalannotation.

As you said, Zope 3 does currently take the tack of transient adapters, although there is a common way to effectively have persistent adapters. The Zope 3 transient adapters can store their information persistently in annotations or other similar structures: object annotations, principal annotations, session data, or elsewhere. Thus you effectively get persistent adapters, with the data compartmentalized, and sometimes discarded, on the basis of how you store it. You can even store instances themselves in these annotations, and have the registered adapters just functions that look up the instances, creating them if necessary.

As I said, it sounds like you might want the principal annotations flavor of this approach.

Gary

_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to