okfn/ckan — pull request #233 by amercader (2012-12-20 12:11:08+00:00)
Title: 3022 IDatasetForm fixes

This pull request adds fixes and new functionality to properly support dataset types on 2.0.

Some highlights:
* Packages have now a default 'dataset' type (up until now it was None). This makes *much* easier searching (see below), but I'm happy to discuss any implication I haven't think of.

* On the search page (/dataset) only normal datasets are shown by default. This can be changed via a config option to show all dataset types. When visiting a particular type search page (/my-dataset-type), only datasets of this type are returned.

* When registering a package type, all urls are named `type_action` (eg my-type_new, my-type_edit, ...) to allow generating the urls from extensions, etc. as a call to url_for with control, action etc did not generate a url for a non deafult type

* facet_list template and the helper functions it uses have been modified to allow passing an alternative_url, otherwise the default url (/dataset) was always generated. (@tobes and @johnmartin let me know if you are happy with changes to facet_list.html and helpers)

As reference, this branch of ckanext-harvest is using these changes to handle dataset types for harvest sources, and has custom templates, etc:

https://github.com/okfn/ckanext-harvest/tree/2.0-dataset-sources