plugins tickets import, jp (ticket/import): implemented mapping:
- mapping is an option allowing do map imported field to a specific field in the newly created item - importers can now use complexe data types in options using JSON
This commit is contained in:
parent
baaa4b1419
commit
55a5b603fd
1 changed files with 53 additions and 5 deletions
|
|
@ -26,6 +26,7 @@ from sat.core import exceptions
|
|||
from functools import partial
|
||||
import collections
|
||||
import uuid
|
||||
import json
|
||||
|
||||
|
||||
PLUGIN_INFO = {
|
||||
|
|
@ -110,6 +111,11 @@ class ImportPlugin(object):
|
|||
options[option] = C.bool(options[option])
|
||||
except KeyError:
|
||||
pass
|
||||
for option in import_handler.JSON_OPTIONS:
|
||||
try:
|
||||
options[option] = json.loads(options[option])
|
||||
except ValueError:
|
||||
raise exceptions.DataError(_(u'invalid json option: {name}').format(name=option))
|
||||
return self.doImport(client, import_handler, unicode(name), unicode(location), options, pubsub_service or None, pubsub_node or None)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
|
|||
Loading…
Reference in a new issue