[#29] Fix some imports on actions and plugin

This commit is contained in:
amercader 2013-03-28 15:00:44 +00:00
parent c754479014
commit fbc8ecde97
4 changed files with 13 additions and 6 deletions

View File

@ -8,7 +8,7 @@ from ckanext.harvest.logic import HarvestJobExists
from ckanext.harvest.plugin import DATASET_TYPE_NAME from ckanext.harvest.plugin import DATASET_TYPE_NAME
from ckanext.harvest.model import (HarvestSource, HarvestJob) from ckanext.harvest.model import (HarvestSource, HarvestJob)
from ckanext.harvest.logic.dictization import harvest_job_dictize from ckanext.harvest.logic.dictization import harvest_job_dictize
from ckanext.harvest.logic.schema import harvest_source_db_to_form_schema from ckanext.harvest.logic.schema import harvest_source_show_package_schema
from ckanext.harvest.logic.action.get import harvest_source_list,harvest_job_list from ckanext.harvest.logic.action.get import harvest_source_list,harvest_job_list
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -58,7 +58,7 @@ def harvest_source_create(context,data_dict):
context['extras_as_string'] = True context['extras_as_string'] = True
package_dict = logic.get_action('package_create')(context, data_dict) package_dict = logic.get_action('package_create')(context, data_dict)
context['schema'] = harvest_source_db_to_form_schema() context['schema'] = harvest_source_show_package_schema()
source = logic.get_action('package_show')(context, package_dict) source = logic.get_action('package_show')(context, package_dict)
return source return source

View File

@ -20,8 +20,7 @@ from ckanext.harvest.queue import get_gather_publisher
from ckanext.harvest.model import HarvestSource, HarvestJob, HarvestObject from ckanext.harvest.model import HarvestSource, HarvestJob, HarvestObject
from ckanext.harvest.logic import HarvestJobExists from ckanext.harvest.logic import HarvestJobExists
from ckanext.harvest.logic.schema import harvest_source_db_to_form_schema from ckanext.harvest.logic.schema import harvest_source_show_package_schema
from ckanext.harvest.logic.action.get import harvest_source_show, harvest_job_list, _get_sources_for_user from ckanext.harvest.logic.action.get import harvest_source_show, harvest_job_list, _get_sources_for_user
@ -75,7 +74,7 @@ def harvest_source_update(context,data_dict):
context['extras_as_string'] = True context['extras_as_string'] = True
package_dict = logic.get_action('package_update')(context, data_dict) package_dict = logic.get_action('package_update')(context, data_dict)
context['schema'] = harvest_source_db_to_form_schema() context['schema'] = harvest_source_show_package_schema()
source = logic.get_action('package_show')(context, package_dict) source = logic.get_action('package_show')(context, package_dict)
return source return source

View File

@ -56,6 +56,12 @@ def harvest_source_create_package_schema():
return schema return schema
def harvest_source_update_package_schema():
schema = harvest_source_create_package_schema()
return schema
def harvest_source_show_package_schema(): def harvest_source_show_package_schema():
schema = harvest_source_schema() schema = harvest_source_schema()

View File

@ -153,8 +153,10 @@ class Harvest(p.SingletonPlugin, DefaultDatasetForm):
Returns the schema for mapping package data from a form to a format Returns the schema for mapping package data from a form to a format
suitable for the database. suitable for the database.
''' '''
return self.create_package_schema() from ckanext.harvest.logic.schema import harvest_source_update_package_schema
schema = harvest_source_update_package_schema()
return schema
def show_package_schema(self): def show_package_schema(self):
''' '''