<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>CKAN: Ticket #961: [super] Refactoring of forms, validation and model synchronization</title>
    <link>http://localhost/ticket/961</link>
    <description>&lt;p&gt;
This is a meta-ticket to hold all of the work on refactoring forms, validation and model-synchronization in CKAN.
&lt;/p&gt;
&lt;p&gt;
ckan-dev thread: &lt;a class="ext-link" href="http://lists.okfn.org/pipermail/ckan-dev/2011-January/000180.html"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://lists.okfn.org/pipermail/ckan-dev/2011-January/000180.html&lt;/a&gt;
&lt;/p&gt;
&lt;h2 id="TheIssue"&gt;The Issue&lt;/h2&gt;
&lt;p&gt;
From &lt;a class="closed ticket" href="http://localhost/ticket/926" title="enhancement: Pick a simpler form framework (closed: fixed)"&gt;#926&lt;/a&gt;:
&lt;/p&gt;
&lt;p&gt;
The current formalchemy setup conflates view, controller and model code in a way that makes it hard to debug and customise.
&lt;/p&gt;
&lt;p&gt;
From &lt;a class="ext-link" href="http://lists.okfn.org/pipermail/ckan-dev/2011-January/000181.html"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://lists.okfn.org/pipermail/ckan-dev/2011-January/000181.html&lt;/a&gt;:
&lt;/p&gt;
&lt;p&gt;
... FormAlchemy, in retrospect, was probably a mistake as it merges too much model/validation/form generation into one thing.
&lt;/p&gt;
&lt;p&gt;
At least 3 functions involved [in this area]:
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Generating (or just filling) a form template with 'form data' (and errors)
&lt;/li&gt;&lt;li&gt;Converting model data to form data (also happens for APIs in fact) -- let's call this 'dict-ization'
&lt;/li&gt;&lt;li&gt;Converting form data to model data (and validating) (inverse of previous step)
&lt;/li&gt;&lt;/ol&gt;&lt;h2 id="RelatedTickets"&gt;Related Tickets&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;a class="closed ticket" href="http://localhost/ticket/926" title="enhancement: Pick a simpler form framework (closed: fixed)"&gt;#926&lt;/a&gt; - Pick a simpler form framework
&lt;/li&gt;&lt;li&gt;&lt;a class="closed ticket" href="http://localhost/ticket/1046" title="enhancement: Dictization and the new logic layer (closed: fixed)"&gt;#1046&lt;/a&gt; 'dictization' and the logic layer - serialization / deserialization of package (and other domain objects) to standard intermediate format such as json-convertable python dict
&lt;ul&gt;&lt;li&gt;Refactor API to use new logic layer and dictization &lt;a class="closed ticket" href="http://localhost/ticket/1079" title="enhancement: Refactor API to use new logic layer and dictization (closed: fixed)"&gt;#1079&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;Refactor WUI controllers and forms to use logic layer - &lt;a class="closed ticket" href="http://localhost/ticket/1078" title="enhancement: Refactors WUI controllers and forms to use logic layer (closed: fixed)"&gt;#1078&lt;/a&gt;
&lt;/li&gt;&lt;li&gt;cf existing dumper and importer code
&lt;/li&gt;&lt;li&gt;This will fix &lt;a class="closed ticket" href="http://localhost/ticket/662" title="defect: Can't put entity that is returned by posting to package register (closed: fixed)"&gt;#662&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;[not ticketed yet] - validation layer (should work on serialized objects?)
&lt;/li&gt;&lt;li&gt;&lt;a class="closed ticket" href="http://localhost/ticket/662" title="defect: Can't put entity that is returned by posting to package register (closed: fixed)"&gt;#662&lt;/a&gt; - Can't put entity that is returned by posting to package register (Defect)
&lt;/li&gt;&lt;li&gt;&lt;a class="closed ticket" href="http://localhost/ticket/972" title="enhancement: Merge 'extras' into main package dict rather than having separate key (closed: wontfix)"&gt;#972&lt;/a&gt; - Merge 'extras' into main package dict rather than having separate key
&lt;/li&gt;&lt;li&gt;&lt;a class="closed ticket" href="http://localhost/ticket/1035" title="enhancement: Form impressions given an ID (closed: wontfix)"&gt;#1035&lt;/a&gt; - Form impressions are given IDs
&lt;/li&gt;&lt;li&gt;&lt;a class="closed ticket" href="http://localhost/ticket/810" title="enhancement: Move &amp;#34;add packages&amp;#34; field up in group form (closed: wontfix)"&gt;#810&lt;/a&gt; - Move "add packages" field up in group form (easier to do this once forms are done)
&lt;/li&gt;&lt;/ul&gt;</description>
    <language>en-us</language>
    <image>
      <title>CKAN</title>
      <url>http://assets.okfn.org/p/ckan/img/ckan_logo_shortname.png</url>
      <link>http://localhost/ticket/961</link>
    </image>
    <generator>Trac 0.12.3</generator>
    <item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Mon, 07 Feb 2011 10:14:18 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/961#comment:1</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:1</guid>
      <description>
        &lt;p&gt;
So you also need:
&lt;/p&gt;
&lt;ol start="4"&gt;&lt;li&gt;Converting form data to dict
&lt;/li&gt;&lt;li&gt;Converting dict to model
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;
i.e. the dict is not the same as the serialized form data or model data.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Thu, 10 Feb 2011 10:05:03 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/961#comment:2</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:2</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/961?action=diff&amp;amp;version=2"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>sebbacon</dc:creator>

      <pubDate>Mon, 28 Feb 2011 09:20:44 GMT</pubDate>
      <title>milestone changed</title>
      <link>http://localhost/ticket/961#comment:3</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-v1.4-sprint-1&lt;/em&gt; to &lt;em&gt;ckan-v1.4-sprint-3&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>dread</dc:creator>

      <pubDate>Fri, 11 Mar 2011 15:39:58 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/961#comment:4</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:4</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/961?action=diff&amp;amp;version=4"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Mon, 14 Mar 2011 09:09:41 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/961#comment:5</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:5</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/961?action=diff&amp;amp;version=5"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Thu, 24 Mar 2011 14:55:02 GMT</pubDate>
      <title>description changed; repo, theme set</title>
      <link>http://localhost/ticket/961#comment:6</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:6</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;repo&lt;/strong&gt;
                set to &lt;em&gt;ckan&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;theme&lt;/strong&gt;
                set to &lt;em&gt;none&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/961?action=diff&amp;amp;version=6"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Mon, 28 Mar 2011 09:47:51 GMT</pubDate>
      <title>owner, summary, milestone changed</title>
      <link>http://localhost/ticket/961#comment:7</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:7</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;sebbacon&lt;/em&gt; to &lt;em&gt;kindly&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;summary&lt;/strong&gt;
                changed from &lt;em&gt;Refactoring of forms, validation and model synchronization&lt;/em&gt; to &lt;em&gt;[super] Refactoring of forms, validation and model synchronization&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;milestone&lt;/strong&gt;
                changed from &lt;em&gt;ckan-v1.4-sprint-3&lt;/em&gt; to &lt;em&gt;ckan-v1.4&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Mon, 11 Apr 2011 08:12:53 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/961#comment:8</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:8</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/961?action=diff&amp;amp;version=8"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Mon, 11 Apr 2011 08:13:20 GMT</pubDate>
      <title>description changed</title>
      <link>http://localhost/ticket/961#comment:9</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:9</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;description&lt;/strong&gt;
              modified (&lt;a href="/ticket/961?action=diff&amp;amp;version=9"&gt;diff&lt;/a&gt;)
            &lt;/li&gt;
          &lt;/ul&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>rgrp</dc:creator>

      <pubDate>Thu, 16 Jun 2011 13:14:18 GMT</pubDate>
      <title></title>
      <link>http://localhost/ticket/961#comment:10</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:10</guid>
      <description>
        &lt;p&gt;
@kindly: can we close this ticket now. All the meat is done and the remaining related tickets are either low priority or possibly wontfix.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>shevski</dc:creator>

      <pubDate>Fri, 08 Jul 2011 11:55:00 GMT</pubDate>
      <title>status changed; resolution set</title>
      <link>http://localhost/ticket/961#comment:11</link>
      <guid isPermaLink="false">http://localhost/ticket/961#comment:11</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
The main parts of this ticket are now done. The remaining parts can be dealt with separately as their own tickets.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>