[Zope3-Users] Re: how to catalog principal annotations?
gary at zope.com
Fri Nov 3 11:44:36 EST 2006
On Nov 3, 2006, at 11:39 AM, Philipp von Weitershausen wrote:
> Dominique Lederer wrote:
>> I have users residing in an external database.I store user data with
>> principal annotations. Now i want to create a view where users with a
>> special annotation are listed.
>> Is it possible to catalog principal annotations and how?
> Sure. catalog.index_doc(obj) should do it (where obj is the
> principal). Then you should have an indices configured to index
> whichever fields you want to index. Of course, those fields should
> be coming from an adapter for the principal that you have to
> create. THe adapter would look at the principal's annotation.
This will work if you have a key reference implementation
specifically for principals. The default key reference impl. is just
for persistent objects, and standard Zope 3 principals are transient,
generated for the current request by the pluggable auth utility.
More information about the Zope3-users