From: Ross Jones Date: Fri, 09 Dec 2011 15:36:08 +0000 Subject: Making sure we can determine whether the group_form() func was called X-Git-Url: http://maxious.lambdacomplex.org/git/?p=ckanext-datagovau.git&a=commitdiff&h=7f3278199a080c9624b4278692d250c59036c841 --- Making sure we can determine whether the group_form() func was called --- --- a/ckanext/example/forms.py +++ b/ckanext/example/forms.py @@ -16,7 +16,7 @@ from ckan.lib.navl.dictization_functions import Invalid from ckan.lib.navl.dictization_functions import validate, missing from ckan.lib.navl.dictization_functions import DataError, flatten_dict, unflatten -from ckan.plugins import IDatasetForm, IConfigurer +from ckan.plugins import IDatasetForm, IGroupForm, IConfigurer from ckan.plugins import implements, SingletonPlugin from ckan.lib.navl.validators import (ignore_missing, @@ -63,7 +63,22 @@ Returns a string representing the location of the template to be rendered. e.g. "forms/group_form.html". """ + from pdb import set_trace; set_trace() + return 'forms/group_form.html' + + def group_types(self): + """ + Returns an iterable of group type strings. + + If a request involving a group of one of those types is made, then + this plugin instance will be delegated to. + + There must only be one plugin registered to each group type. Any + attempts to register more than one plugin instance to a given group + type will raise an exception at startup. + """ + return ["example"] def is_fallback(self): """ --- a/ckanext/example/theme/templates/forms/group_form.html +++ b/ckanext/example/theme/templates/forms/group_form.html @@ -14,7 +14,7 @@
-
+