Hi Justin,<br><br>That&#39;s crafty hook with &quot;factories&quot; to build annnotation, yes :)<br>It seems you missed Persistent inheritance for that adapter factory, i.e.::<br><br>class GeoCodedLocation(<b style="color: rgb(102, 0, 0);">Persistent</b>):<br>
    implements(IGeoCodedLocation)<br>
    adapts(IGeoLocation)<br>
<br>
    def __init__(self, context):<br>
        self.longitude = 0.0<br>       
self.latitude = 0.0<br><br><div class="gmail_quote">2010/6/18 Justin Ryan <span dir="ltr">&lt;<a href="mailto:justin.ryan@reliefgarden.org">justin.ryan@reliefgarden.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
FWIW, when I put the lat/long schema fields onto IGeoLocation, and<br>
changed all adaptions from IGeoCodedLocation to IGeoLocation, which of<br>
course the object already implemented, everything worked.<br>
<br>
There are some details in here where, I set the form up with two<br>
schemas, but the IGeoLocation adaption was just the original object.<br>
<br>
If what I&#39;m doing is crazy, I&#39;d appreciate any input, and be happy to<br>
help impart that wisdom into the BB docs.<br>
<div><div></div><div class="h5"><br>
On Thu, Jun 17, 2010 at 6:05 PM, Justin Ryan<br>
&lt;<a href="mailto:justin.ryan@reliefgarden.org">justin.ryan@reliefgarden.org</a>&gt; wrote:<br>
&gt; Howdy!<br>
&gt;<br>
&gt; I&#39;m trying to use an Attribute Annotation Adapter to store Geo<br>
&gt; Location info on some content types.  Roughly, I&#39;ve been following the<br>
&gt; doctest at:<br>
&gt;<br>
&gt;  <a href="http://pypi.python.org/pypi/zope.annotation" target="_blank">http://pypi.python.org/pypi/zope.annotation</a><br>
&gt;<br>
&gt; I am happy to provide example code, what I have is a bit frazzled at<br>
&gt; the moment because I upgraded my mac to snow leopard the other day and<br>
&gt; apparently failed to commit the last set of changes to my project.<br>
&gt; Whups.<br>
&gt;<br>
&gt; Basically, here&#39;s the thing.<br>
&gt;<br>
&gt; I have a couple interfaces:<br>
&gt;<br>
&gt; class  IGeoLocation(Interface):<br>
&gt;  address = TextLine(title=u&quot;Address&quot;)<br>
&gt;<br>
&gt; class IGeoCodedLocation(Interface)<br>
&gt;  latitude = Float(title=u&quot;Latitude&quot;)<br>
&gt;  longitude = Float(title=u&quot;Longitude&quot;)<br>
&gt;<br>
&gt; I have an annotation adapter, as best I could manage:<br>
&gt;<br>
&gt; class GeoCodedLocation(object):<br>
&gt;  implements(IGeoCodedLocation)<br>
&gt;  adapts(IGeoLocation)<br>
&gt;<br>
&gt;  def __init__(self, context):<br>
&gt;    self.longitude = 0.0<br>
&gt;    self.latitude = 0.0<br>
&gt;<br>
&gt; I have an event subscriber for (IObjectModified, IGeoLocation) which<br>
&gt; is able to successfully adapt my original content type implement<br>
&gt; IGeoLocation to an IGeoCodedLocation, hit the Google Geocoding API,<br>
&gt; and log the geocoded lat and long.  I am able to log the lat and log<br>
&gt; values from the adapted IGeoCodedLocation object.<br>
&gt;<br>
&gt; But, it doesn&#39;t persist.  The next view of the object shows 0.0, 0.0.<br>
&gt;<br>
&gt; I have a report of someone who had a similar problem with grok.  Is<br>
&gt; this an underutilized feature that has a problem, or am I a completely<br>
&gt; delusional idiot?<br>
&gt;<br>
&gt; :)<br>
&gt;<br>
&gt; Of course, I wish to contribute to the BlueBream docs info on this<br>
&gt; because Attribute Annotation Adapters are a super freaking handy<br>
&gt; pattern which are far more lightweight than containment for ancillary<br>
&gt; functionality like commenting, rating, geolocation, etc..<br>
&gt;<br>
&gt; Best,<br>
&gt;<br>
&gt; Justin<br>
&gt;<br>
_______________________________________________<br>
bluebream mailing list<br>
<a href="mailto:bluebream@zope.org">bluebream@zope.org</a><br>
<a href="https://mail.zope.org/mailman/listinfo/bluebream" target="_blank">https://mail.zope.org/mailman/listinfo/bluebream</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ilshad R. Khabibullin<br><a href="http://astoon.zwiki.org">http://astoon.zwiki.org</a><br>+7 922 600 56 06<br>