Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import ckan.controllers.group as group | ||
|
||
class OrganizationController(group.GroupController): | ||
|
||
# this makes us use organization actions | ||
group_type = 'organization' | ||
|
||
def _group_form(self, group_type=None): | ||
return 'organization/new_organization_form.html' | ||
|
||
def _form_to_db_schema(self, group_type=None): | ||
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_group_plugin(group_type).db_to_form_schema() | ||
|
||
def _setup_template_variables(self, context, data_dict, group_type=None): | ||
pass | ||
|
||
def _new_template(self, group_type): | ||
return 'organization/new.html' | ||
|
||
def _index_template(self, group_type): | ||
return 'organization/index.html' | ||
|
||
def _read_template(self, group_type): | ||
return lookup_group_plugin(group_type).read_template() | ||
|
||
def _history_template(self, group_type): | ||
return lookup_group_plugin(group_type).history_template() | ||
|
||
def _edit_template(self, group_type): | ||
return lookup_group_plugin(group_type).edit_template() | ||
|
||
def _guess_group_type(self, expecting_name=False): | ||
return 'organization' |