[Grok-dev] Entity Relations and Forms
faassen at startifact.com
Fri Aug 22 20:57:50 EDT 2008
My apologies that nobody replied to you for so long. We organize a
"reply group" that makes sure every posting to the list (except spam!)
gets a reply!
> I'm new to Grok (and Zope 3).
> ... I could accomplish the same thing by creating a
> vocabulary out the my container full of Contributors.
> Which method is preferable? What's the common pattern for doing something
> like this?
I think the best library to look at is zc.sourcefactory:
you can include this as a dependency in your project's setup.py. Perhaps
you may want to lock it down to a particular version in a [versions]
list in buildout.cfg as well.
You'd use it something like this:
contributor = schema.Choice(
Off the top of my head, your ContributorSource could be implemented
something like this:
# assuming 'contributors' is a subfolder in your site...
def getTitle(self, value):
A late answer, but I hope this helps!
More information about the Grok-dev