Skip to content

Commit

Permalink
better imports in package and group controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Feb 29, 2012
1 parent 36b2cb6 commit 17429d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions ckan/controllers/group.py
Expand Up @@ -14,7 +14,7 @@
import ckan.forms
import ckan.logic.action.get

from lib.plugins import lookup_group_plugin as _lookup_plugin
from lib.plugins import lookup_group_plugin

log = logging.getLogger(__name__)

Expand All @@ -24,18 +24,18 @@ class GroupController(BaseController):
## hooks for subclasses

def _group_form(self, group_type=None):
return _lookup_plugin(group_type).group_form()
return lookup_group_plugin(group_type).group_form()

def _form_to_db_schema(self, group_type=None):
return _lookup_plugin(group_type).form_to_db_schema()
return lookup_group_plugin(group_type).form_to_db_schema()

def _db_to_form_schema(self, group_type=None):
'''This is an interface to manipulate data from the database
into a format suitable for the form (optional)'''
return _lookup_plugin(group_type).form_to_db_schema()
return lookup_group_plugin(group_type).form_to_db_schema()

def _setup_template_variables(self, context, data_dict, group_type=None):
return _lookup_plugin(group_type).setup_template_variables(context,data_dict)
return lookup_group_plugin(group_type).setup_template_variables(context,data_dict)

## end hooks

Expand Down
12 changes: 6 additions & 6 deletions ckan/controllers/package.py
Expand Up @@ -23,7 +23,7 @@
import ckan.logic.action.get
from home import CACHE_PARAMETER

from lib.plugins import lookup_package_plugin as _lookup_plugin
from lib.plugins import lookup_package_plugin

log = logging.getLogger(__name__)

Expand All @@ -45,23 +45,23 @@ def search_url(params):
class PackageController(BaseController):

def _package_form(self, package_type=None):
return _lookup_plugin(package_type).package_form()
return lookup_package_plugin(package_type).package_form()

def _form_to_db_schema(self, package_type=None):
return _lookup_plugin(package_type).form_to_db_schema()
return lookup_package_plugin(package_type).form_to_db_schema()

def _db_to_form_schema(self, package_type=None):
'''This is an interface to manipulate data from the database
into a format suitable for the form (optional)'''
return _lookup_plugin(package_type).db_to_form_schema()
return lookup_package_plugin(package_type).db_to_form_schema()

def _check_data_dict(self, data_dict, package_type=None):
'''Check if the return data is correct, mostly for checking out if
spammers are submitting only part of the form'''
return _lookup_plugin(package_type).check_data_dict(data_dict)
return lookup_package_plugin(package_type).check_data_dict(data_dict)

def _setup_template_variables(self, context, data_dict, package_type=None):
return _lookup_plugin(package_type).setup_template_variables(context, data_dict)
return lookup_package_plugin(package_type).setup_template_variables(context, data_dict)

authorizer = ckan.authz.Authorizer()

Expand Down

0 comments on commit 17429d0

Please sign in to comment.