Skip to content

Commit

Permalink
Rename package_form_schema() -> form_to_db_package_schema()
Browse files Browse the repository at this point in the history
The only purpose of this schema is to be used as a base schema by
IDatasetForm plugins for their form_to_db_schema() methods, hopefully
the new name makes that clearer
  • Loading branch information
Sean Hammond committed Jul 6, 2012
1 parent 126c94b commit 786479e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ckan/lib/plugins.py
Expand Up @@ -228,8 +228,8 @@ def form_to_db_schema_options(self, options):
else:
return self.form_to_db_schema()

def form_to_db_schema(self, options):
return logic.schema.package_form_schema()
def form_to_db_schema(self):
return logic.schema.form_to_db_package_schema()

def form_to_db_schema_api_create(self):
return logic.schema.default_create_package_schema()
Expand Down Expand Up @@ -397,7 +397,7 @@ def check_data_dict(self, data_dict):
'extras_validation', 'save', 'return_to',
'resources']
schema_keys = package_form_schema().keys()
schema_keys = form_to_db_package_schema().keys()
keys_in_schema = set(schema_keys) - set(surplus_keys_schema)
missing_keys = keys_in_schema - set(data_dict.keys())
Expand Down
2 changes: 1 addition & 1 deletion ckan/logic/schema.py
Expand Up @@ -152,7 +152,7 @@ def default_update_package_schema():

return schema

def package_form_schema():
def form_to_db_package_schema():

schema = default_package_schema()
##new
Expand Down
2 changes: 1 addition & 1 deletion ckan/tests/schema/test_schema.py
Expand Up @@ -94,7 +94,7 @@ def test_tag_string_parsing(self):
# errors correctly.
context = {'model': ckan.model,
'session': ckan.model.Session}
schema = ckan.logic.schema.package_form_schema()
schema = ckan.logic.schema.form_to_db_package_schema()

# basic parsing of comma separated values
tests = (('tag', ['tag'], []),
Expand Down
1 change: 0 additions & 1 deletion ckanext/publisher_form/forms.py
Expand Up @@ -9,7 +9,6 @@
from ckan.logic import tuplize_dict, clean_dict, parse_params
import ckan.logic.schema as default_schema
from ckan.logic.schema import group_form_schema
from ckan.logic.schema import package_form_schema
import ckan.logic.validators as val
from ckan.lib.base import BaseController, render, c, model, abort, request
from ckan.lib.base import redirect, _, config, h
Expand Down
2 changes: 1 addition & 1 deletion ckanext/test_tag_vocab_plugin.py
Expand Up @@ -7,7 +7,7 @@
from genshi.filters import Transformer
from ckan.logic import get_action
from ckan.logic.converters import convert_to_tags, convert_from_tags, free_tags_only
from ckan.logic.schema import package_form_schema, default_package_schema
from ckan.logic.schema import default_package_schema
from ckan.lib.navl.validators import ignore_missing, keep_extras
from ckan import plugins

Expand Down

0 comments on commit 786479e

Please sign in to comment.