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">&lt;<a href="mailto:faassen@startifact.com">faassen@startifact.com</a>&gt;</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&#39;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">&gt; I still have a small issue if I want to remove my app:<br>
&gt;  File<br>
&gt; &quot;c:\docume~1\jm\.buildout\eggs\z3c.relationfield-0.4.1-py2.4.egg\z3c\relationfield\event.py&quot;,<br>
&gt; line 36, in removeRelations<br>
&gt;     catalog = component.getUtility(ICatalog)<br>
&gt;  File<br>
&gt; &quot;C:\Docume~1\jm\.buildout\eggs\zope.component-3.4.0-py2.4.egg\zope\component\_api.py&quot;,<br>
&gt; line 207, in getUtility<br>
&gt;     raise ComponentLookupError(interface, name)<br>
&gt; ComponentLookupError: (&lt;InterfaceClass zc.relation.interfaces.ICatalog&gt;, &#39;&#39;)<br>
&gt;<br>
&gt; It seems the catalog is unregistered before the objects are removed, or<br>
&gt; something of that nature...<br>
<br>
</div>Yes, it must be some deregistration order issue. I&#39;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>
&gt; At least I can write a nice how-to now!<br>
<br>
</div>Great!<br>
<div class="Ih2E3d"><br>
&gt; BTW: I had already found a nicer way to use a regular choice field with a<br>
&gt; relation than what I described before, but I&#39;ll put it in the how-to as<br>
&gt; well.<br>
<br>
</div>I&#39;d be interested in learning about this too.<br>
<div class="Ih2E3d"><br>
&gt; Speaking of how-to&#39;s: I already made a how-to on zc.sourcefactory that I<br>
&gt; submitted for reviewing, but it hasn&#39;t been reviewed yet. Do I need to do<br>
&gt; anything more? Or is this no longer the way how-to&#39;s should be submited?<br>
<br>
</div>Oh, just make noise on this list when you have something to review, I<br>
don&#39;t think we have people watching what there is to review...<br>
<br>
I&#39;ll look at it now. That looks like a very nice introduction, so I&#39;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>