简体   繁体   中英

Are Dexterity z3c relations between non-cataloged content possible?

Specifically, I want to be able to use Dexterity content that has a z3c relationfield pointing to a user in acl_users.source_users. The Plone documentation demonstrates how to create relations in the schema using plone.formwidget.contenttree, but the binders all seem to be based on catalog searches. Since users aren't content in this sense they aren't cataloged.

I'm not sure if this is even the best approach, but being able to link to a user seems simple as an abstract concept. I suppose the alternative would be to store the userid as a simple string field and listen for user management events.

There are two possible approaches:

(1) low-level indexing of relationships between content and users, possibly collective.subscribe (disclosure, I am the principal author, and the only example of this in use is collective.inviting , an event RSVP add-on). There are no widgets or UIs for this.

(2) If you simply want to pick users, you could just use a Choice field in your schema with a dynamic vocabulary of users in your system ( example ), and store the user-id on your content (unrelated warning: user name and user id can be distinct from each other; if you use email as login in Plone 4, I suggest you use collective.emaillogin4 ). The content tree widget is not going to work here, so look at either using a drop-down (for <200 users) or an auto-complete widget).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM