[ckan-dev] new extra-field

Sean Hammond sean.hammond at okfn.org
Thu Oct 4 17:30:15 BST 2012


Can you post the full Python traceback?

I'm not sure if you should have '__extras': [ignore] in your schema, and
also your schema should be based on default_package_schema or
default_group_schema (see how it's done in the example I linked to)

On Thu, Oct 04, 2012 at 11:15:17AM +0200, Crossbreed wrote:
> <html><body><div>Hi!</div>
> <div>&nbsp;</div>
> <div>Thank you!<br /><br />I don&#39;t know why, but with the following schema I get an &quot;Integrity Error&quot;. How could I fix it?<br /><br /><br />form_to_db_schema:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;education&#39;: {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;id&#39;: [convert_to_extras, ignore_missing, unicode],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;__extras&#39;: [ignore],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br /><br />db_to_form_schema:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br /><br />&nbsp;&nbsp; &nbsp;&#39;education&#39;: {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;id&#39;: [convert_from_extras, ignore_missing, unicode],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs
>  p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;__extras&#39;: [ignore],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br /><br /><br />In the form-file:<br /><br /><br />&nbsp;&lt;div class=&quot;control-group education-field&quot;&gt;<br />&nbsp;&nbsp;&nbsp; &lt;label class=&quot;control-label-required&quot; for=&quot;education_id&quot;&gt;Education&lt;em class=&quot;star&quot;&gt;*&lt;/em&gt;&lt;/label&gt;<br />&nbsp;&nbsp;&nbsp; &lt;div class=&quot;controls&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;py:with vars=&quot;educations=data.get(&#39;education&#39;,[])&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;strong py:if=&quot;len(educations)&gt;0&quot;&gt;Member of:&lt;/strong&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;py:for each=&quot;num, edu in enumerate(educations)&quot;&gt;<br />&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=&quot;checkbox&quot; py:if=&quot;&#39;id&#39; in edu&quot;&gt;<br 
>  />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input type=&quot;checkbox&quot; name=&quot;educations__${num}__id&quot; checked=&quot;checked&quot; value=&quot;${edu[&#39;id&#39;]}&quot;/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;label for=&quot;educations__${num}__checked&quot;&gt;${edu.get(&#39;id&#39;, &#39;&#39;)}&lt;/label&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/py:for&gt;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;select class=&quot;short&quot; id=&quot;educations&quot; name=&quot;educations&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;option selected=&quot;selected&quot; value=&quot;&quot;&gt;(None)&lt;/option&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;py:for each=&quot;edu_desc, edu_id in c.educations&quot;&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;option value=&quot;${edu_id}&quot; &gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&
>  nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${edu_desc}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/option&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/py:for&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/select&gt;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/py:with&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br />&nbsp; &lt;/div&gt;</div><br/><br/><hr/>Schau dir gleich die Seite von hsdf an! <a href="http://my.sms.at/crossbreed/" target="profil_sms_at">http://my.sms.at/crossbreed/</a><br/><hr/>Dein Eventkalender auf sms.at! Events anlegen, Freunde einladen & kein Top-Event mehr verpassen! <a href="http://www.sms.at/events/">http://www.sms.at/events/</a><br/></body></html>



More information about the ckan-dev mailing list