From: David Read Date: Tue, 28 Jun 2011 12:01:16 +0000 Subject: [form]: Get form working with CKAN 1.4.1 (formalchemy deprecated). X-Git-Url: https://maxious.lambdacomplex.org/git/?p=ckanext-datagovau.git&a=commitdiff&h=5ba6ef97b6e2d660c1409a327798f5d4ab76c4d7 --- [form]: Get form working with CKAN 1.4.1 (formalchemy deprecated). --- --- a/ckanext/exampletheme/package_form.py +++ b/ckanext/exampletheme/package_form.py @@ -22,7 +22,7 @@ # Layout field_groups = OrderedDict([ - (_('Basic information'), ['title', 'name', 'url', + (_('Customised Basic information'), ['title', 'name', 'url', 'notes', 'tags']), (_('Details'), ['author', 'author_email', 'groups', 'maintainer', 'maintainer_email', --- a/ckanext/exampletheme/plugin.py +++ b/ckanext/exampletheme/plugin.py @@ -79,8 +79,15 @@ Note that we have also provided a custom register form template at ``theme/templates/user/register.html``. """ - map.connect('/user/register', + # Note that when we set up the route, we must use the form + # that gives it a name (i.e. in this case, 'register'), so it + # works correctly with the url_for helper:: + # h.url_for('register') + map.connect('register', + '/user/register', controller='ckanext.exampletheme.controller:CustomUserController', action='custom_register') + map.connect('/package/new', controller='package_formalchemy', action='new') + map.connect('/package/edit/{id}', controller='package_formalchemy', action='edit') return map