Révision 3c33f2ff
Ajouté par Serghei Mihai il y a environ 9 ans
ckanext/ozwillo_organization_api/plugin.py | ||
---|---|---|
14 | 14 |
from ckan.logic.action.create import _group_or_org_create as group_or_org_create |
15 | 15 |
from ckan.logic.action.create import user_create |
16 | 16 |
from ckan.logic.action.delete import _group_or_org_purge |
17 |
from ckan.lib.plugins import DefaultOrganizationForm |
|
17 | 18 |
|
18 | 19 |
plugin_config_prefix = 'ckanext.ozwillo_organization_api.' |
19 | 20 |
|
... | ... | |
150 | 151 |
_group_or_org_purge(context, data_dict, is_org=True) |
151 | 152 |
|
152 | 153 |
|
154 |
class OrganizationForm(plugins.SingletonPlugin, DefaultOrganizationForm): |
|
155 |
""" |
|
156 |
Custom form ignoring 'title' and 'name' organization fields |
|
157 |
""" |
|
158 |
plugins.implements(plugins.IGroupForm) |
|
159 |
|
|
160 |
def is_fallback(self): |
|
161 |
return True |
|
162 |
|
|
163 |
def group_types(self): |
|
164 |
return ('organization',) |
|
165 |
|
|
166 |
def form_to_db_schema(self): |
|
167 |
schema = super(OrganizationForm, self).form_to_db_schema() |
|
168 |
del schema['name'] |
|
169 |
del schema['title'] |
|
170 |
return schema |
|
171 |
|
|
172 |
|
|
153 | 173 |
class OzwilloOrganizationApiPlugin(plugins.SingletonPlugin): |
154 | 174 |
""" |
155 | 175 |
API for OASIS to create and delete an organization |
Formats disponibles : Unified diff
organization title and slug are not editable