diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-12-28 17:10:09 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-12-28 17:10:09 +0100 |
commit | 4bdb574817e87cb847b89c1a0bfea38736db81c0 (patch) | |
tree | b09bb5fab87b10a25e3e928d75b601dca4bf35fa /ishtar_common | |
parent | 4d214bb7abc407208f237345cb83f1cc7d0aad5a (diff) | |
download | Ishtar-4bdb574817e87cb847b89c1a0bfea38736db81c0.tar.bz2 Ishtar-4bdb574817e87cb847b89c1a0bfea38736db81c0.zip |
Imports: default values for many to many
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/data_importer.py | 9 | ||||
-rw-r--r-- | ishtar_common/models.py | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 34f8ebec8..09ef64c26 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -1180,6 +1180,15 @@ class Importer(object): # contruct many dict for each values default_dict = {} + + # # get default values + p = [attribute] + if c_path: + p = list(c_path) + p + p = tuple(p) + if p in self._defaults: + for k in self._defaults[p]: + default_dict[k] = self._defaults[p][k] # # init with simple values that will be duplicated for key in val.keys(): if type(val[key]) not in (list, tuple): diff --git a/ishtar_common/models.py b/ishtar_common/models.py index c657f532d..f720dc5ab 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1539,7 +1539,8 @@ TARGET_MODELS = [ ('archaeological_finds.models.PreservationType', _(u"Preservation type")), ('archaeological_finds.models.ObjectType', _(u"Object type")), ('archaeological_context_records.models.IdentificationType', - _("Identification type")) + _("Identification type")), + ('SupportType', _(u"Support type")), ] TARGET_MODELS_KEYS = [tm[0] for tm in TARGET_MODELS] |