fixed error in save extra fields
This commit is contained in:
parent
005f75fdd1
commit
9d848142c0
|
@ -40,7 +40,7 @@ def remove_check_replicated_custom_key(schema):
|
|||
return schema
|
||||
|
||||
#CREATED BY FRANCESCO MANGIACRAPA FOR OVERRIDING THE package_extras_save FROM dictization.model_save.py
|
||||
#removed in ckan 2.10
|
||||
#removed in ckan 2.10, doesn't save extra fields
|
||||
def _package_extras_save(extra_dicts, obj, context):
|
||||
''' It can save repeated extras as key-value '''
|
||||
allow_partial_update = context.get("allow_partial_update", False)
|
||||
|
@ -253,11 +253,6 @@ class D4Science_ThemePlugin(plugins.SingletonPlugin, toolkit.DefaultDatasetForm)
|
|||
def create_package_schema(self):
|
||||
# let's grab the default schema in our plugin
|
||||
schema = super(D4Science_ThemePlugin, self).create_package_schema()
|
||||
schema.update({
|
||||
'spatial': [
|
||||
toolkit.get_validator('ignore_missing'),
|
||||
toolkit.get_converter('convert_to_extras')]
|
||||
})
|
||||
schema = remove_check_replicated_custom_key(schema)
|
||||
#d.package_dict_save = _package_dict_save
|
||||
return schema
|
||||
|
@ -265,22 +260,12 @@ class D4Science_ThemePlugin(plugins.SingletonPlugin, toolkit.DefaultDatasetForm)
|
|||
#IDatasetForm
|
||||
def update_package_schema(self):
|
||||
schema = super(D4Science_ThemePlugin, self).update_package_schema()
|
||||
schema.update({
|
||||
'spatial': [
|
||||
toolkit.get_validator('ignore_missing'),
|
||||
toolkit.get_converter('convert_to_extras')]
|
||||
})
|
||||
schema = remove_check_replicated_custom_key(schema)
|
||||
return schema
|
||||
|
||||
#IDatasetForm
|
||||
def show_package_schema(self):
|
||||
schema = super(D4Science_ThemePlugin, self).show_package_schema()
|
||||
schema.update({
|
||||
'spatial': [
|
||||
toolkit.get_converter('convert_from_extras'),
|
||||
toolkit.get_validator('ignore_missing')]
|
||||
})
|
||||
schema = remove_check_replicated_custom_key(schema)
|
||||
return schema
|
||||
|
||||
|
@ -337,7 +322,7 @@ class D4Science_ThemePlugin(plugins.SingletonPlugin, toolkit.DefaultDatasetForm)
|
|||
}
|
||||
|
||||
#Overriding package_extras_save method
|
||||
# model_save.package_extras_save = _package_extras_save #rimuovo in ckan 2.10
|
||||
#model_save.package_extras_save = _package_extras_save
|
||||
|
||||
#Overriding index home controller - rimosso in ckan 2.10
|
||||
#d4sHC = d4SHomeController()
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
{% endblock %}
|
||||
|
||||
{% block package_basic_fields_custom %}
|
||||
{{ form.input('spatial', id='field-spatial', label=_('Spatial'),
|
||||
placeholder=_('Geographical extent in GeoJSON format'), value=data.spatial, error=errors.spatial) }}
|
||||
<!-- {{ form.input('spatial', id='field-spatial', label=_('Spatial'),
|
||||
placeholder=_('Geographical extent in GeoJSON format'), value=data.spatial, error=errors.spatial) }} -->
|
||||
{% endblock %}
|
||||
|
||||
{% block package_basic_fields_description %}
|
||||
|
|
Loading…
Reference in New Issue