[Grok-dev] Re: New Grok user with some questions

Martijn Faassen faassen at startifact.com
Thu Jun 26 08:31:52 EDT 2008

On Thu, Jun 26, 2008 at 5:41 AM, cstrong at arielpartners.com
<cstrong at arielpartners.com> wrote:
>> I just mentioned my stealth package z3c.relationfield. I just realized it
>> is actually in Zope's SVN already. It only does 1 to 1 relations right now,
>> but it does index them and so on, making quite powerful queries on the
>> relations possible. It also hasn't been publically released yet. 1 to many
>> relations are still coming.
>> http://svn.zope.org/z3c.relationfield/trunk/src/z3c/relationfield/README.txt
> I am interested to hear more about this: very soon my project will need one
> of these too.
> Martijn, I guess if you went to all the trouble of building your own package
> instead of reusing lovely.relation you must have had some very compelling
> reasons; and I would like to hear them

I don't know whether I had greatly compelling reasons, perhaps I just
like reinventing the wheel. :)

My package focuses on making a relation schema field work on an
arbitrary object, with the intended use in forms. It has no concept of
a relation container. The relation type is implicit and defined by the
name of the field. The source of the relation is also implicit (the
object the field happens to be on). Only the target of the relation is
explicit. You can then ask for "give me all relations from objects
with interface A with the name "foo" to objects with interface B".  I
should write a better README.txt for that package that expresses this
- I only tend to be able to write a good tutorial style README.txt
after I've already written a less good
too-much-testing-too-little-explanation README.txt before.

I couldn't see how lovely.relation could help me very much to do this
for me (but quite possibly I missed something), so I built a package.
Another potential benefit is that it uses the (newer) zc.relation
underneath directly.



More information about the Grok-dev mailing list