Ticket #2350 (new enhancement)

Opened 2 years ago

Last modified 23 months ago

Hooks in package controller for validating form data

Reported by: icmurray Owned by: icmurray
Priority: minor Milestone: ckan-v1.9
Component: ckan Keywords: [0.5d]
Cc: Repository: ckan
Theme: none

Description

When the validation schema was moved from the package controller into the logic layer, the schema's role was changed from that of processing a form and validating data; to just validating data. Whilst is makes sense to have a schema for validating data as it comes in and leaves the logic layer; there's no longer the hook available to PackageController? subclasses to do form validation/processing.

Add a hook into _save_new() and save_edit() prior to the logic-layer call which subclasses can then override.

NB - form processing/validation *is* different to validating data. For example, many data can be inferred from a user's input; or there may be aspects of the form that need to be filled in, but do not make sense to pass as data into the logic-layer, eg. agreeing to T&Cs.

  • [ ] Add hooks
  • [ ] Use in ckanext-example

Change History

comment:1 Changed 2 years ago by icmurray

  • Milestone changed from ckan-sprint-2012-05-15 to ckan-v1.8

comment:2 Changed 23 months ago by icmurray

  • Milestone changed from ckan-v1.8 to ckan-v1.9
Note: See TracTickets for help on using tickets.