[ckan-dev] IDatasetForm: form_to_db_schema_api_create() etc

Toby Dacre toby.okfn at gmail.com
Mon Mar 18 16:52:38 UTC 2013


On 18 March 2013 14:08, Sean Hammond <sean.hammond at okfn.org> wrote:
>> > By the way, why the hack are form_to_db_schema_options' params passed to
>> > it wrapped in a dict!?
>>
>> that seems to be the ckan way context, data_dict etc
>> otherwise we need ...(**kw) in extensions etc which feels just as unreadable
>
> As far as I can see form_to_db_schema_options() is only called by ckan
> internally, and always with the same three options type, api and context, so
> unless I'm missing something there's no reason it couldn't be:
>
>   def form_to_db_schema_options(self, type, api, context)
>
>   form_to_db_schema_options(type='create', api=True, context={...})
>

I'd really like to just unify the schema then we don't need this.  It
was done as part of just getting the tests to pass so we may be able
to fix this properly.  If there is something api specific then we
could provide this through the validators maybe?

that feels a more sensible solution overall and simpler all round


> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev




More information about the ckan-dev mailing list