[ckan-dev] IDatasetForm: form_to_db_schema_api_create() etc

Sean Hammond sean.hammond at okfn.org
Mon Mar 18 17:40:35 UTC 2013


> >> > 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

Fair enough, I'm gonna have a go at unifying the schemas now, and we'll
see if that turns out to be simple or a rabbit hole




More information about the ckan-dev mailing list