Skip to content

Instantly share code, notes, and snippets.

@adamcheasley
Created November 22, 2013 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcheasley/7602227 to your computer and use it in GitHub Desktop.
Save adamcheasley/7602227 to your computer and use it in GitHub Desktop.
relation field in dexterity
from z3c.relationfield.schema import RelationChoice, RelationList
class IRDFFramework(form.Schema):
"""RDF descriptors"""
rdf_framework = RelationList(
title=_(u"RDF Framework"),
default=[],
value_type=RelationChoice(
source=ObjPathSourceBinder(
object_provides=IMetaDescriptor.__identifier__,
navigation_tree_query={"portal_type": [
"vitae.content.metafolder",
"vitae.content.rdfmetaframework",
"vitae.content.metadescriptor",
]}
)
),
required=False,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment