Sorry for ressurecting the topic, but please, a tutorial of Object
Relationships is needed, because for now, object relationships are not
so straightforward and fast to make as could/should be, IMHO.<br><br>Regards<br><br><div class="gmail_quote">2009/2/13 Martijn Faassen <span dir="ltr"><<a href="mailto:faassen@startifact.com">faassen@startifact.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hey,<br>
<br>
I'm glad the basics work now. I was able to encapsulate the choice<br>
behavior quite nicely without too little code. The trick was to derive a<br>
new RelationChoice field so that the relation is actually indexed<br>
properly and so you can pass a source to it. The other trick was to<br>
create a new source factory that you can easily supply with a list of<br>
targets.<br>
<br>
Jeroen Michiel wrote:<br>
[snip]<br>
<div class="Ih2E3d">> I still have a small issue if I want to remove my app:<br>
> File<br>
> "c:\docume~1\jm\.buildout\eggs\z3c.relationfield-0.4.1-py2.4.egg\z3c\relationfield\event.py",<br>
> line 36, in removeRelations<br>
> catalog = component.getUtility(ICatalog)<br>
> File<br>
> "C:\Docume~1\jm\.buildout\eggs\zope.component-3.4.0-py2.4.egg\zope\component\_api.py",<br>
> line 207, in getUtility<br>
> raise ComponentLookupError(interface, name)<br>
> ComponentLookupError: (<InterfaceClass zc.relation.interfaces.ICatalog>, '')<br>
><br>
> It seems the catalog is unregistered before the objects are removed, or<br>
> something of that nature...<br>
<br>
</div>Yes, it must be some deregistration order issue. I've seen those before<br>
in other contexts.. I think the issue could be fixed by placing some<br>
fallback behavior in event.py so that if the catalog is missing things<br>
will proceed without error. Send me a patch or remind me to look at it<br>
again. :)<br>
<div class="Ih2E3d"><br>
> At least I can write a nice how-to now!<br>
<br>
</div>Great!<br>
<div class="Ih2E3d"><br>
> BTW: I had already found a nicer way to use a regular choice field with a<br>
> relation than what I described before, but I'll put it in the how-to as<br>
> well.<br>
<br>
</div>I'd be interested in learning about this too.<br>
<div class="Ih2E3d"><br>
> Speaking of how-to's: I already made a how-to on zc.sourcefactory that I<br>
> submitted for reviewing, but it hasn't been reviewed yet. Do I need to do<br>
> anything more? Or is this no longer the way how-to's should be submited?<br>
<br>
</div>Oh, just make noise on this list when you have something to review, I<br>
don't think we have people watching what there is to review...<br>
<br>
I'll look at it now. That looks like a very nice introduction, so I'll<br>
publish it right away. Thanks very much for writing it, I think people<br>
will be helped by this.<br>
<br>
Regards,<br>
<font color="#888888"><br>
Martijn<br>
</font><div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
Grok-dev mailing list<br>
<a href="mailto:Grok-dev@zope.org">Grok-dev@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">http://mail.zope.org/mailman/listinfo/grok-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Vanderson Mota dos Santos<br><br>