Ticket #961 (closed enhancement: fixed)
[super] Refactoring of forms, validation and model synchronization
|Reported by:||rgrp||Owned by:||kindly|
Description (last modified by rgrp) (diff)
This is a meta-ticket to hold all of the work on refactoring forms, validation and model-synchronization in CKAN.
ckan-dev thread: http://lists.okfn.org/pipermail/ckan-dev/2011-January/000180.html
The current formalchemy setup conflates view, controller and model code in a way that makes it hard to debug and customise.
... FormAlchemy, in retrospect, was probably a mistake as it merges too much model/validation/form generation into one thing.
At least 3 functions involved [in this area]:
- Generating (or just filling) a form template with 'form data' (and errors)
- Converting model data to form data (also happens for APIs in fact) -- let's call this 'dict-ization'
- Converting form data to model data (and validating) (inverse of previous step)
- #926 - Pick a simpler form framework
- #1046 'dictization' and the logic layer - serialization / deserialization of package (and other domain objects) to standard intermediate format such as json-convertable python dict
- [not ticketed yet] - validation layer (should work on serialized objects?)
- #662 - Can't put entity that is returned by posting to package register (Defect)
- #972 - Merge 'extras' into main package dict rather than having separate key
- #1035 - Form impressions are given IDs
- #810 - Move "add packages" field up in group form (easier to do this once forms are done)