summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-14 19:54:52 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-14 19:54:52 +0100
commit87208abf2d2616faad094f33168b491d2a4efcc8 (patch)
tree7abaf9aa8e234bff1da2750dcd718a1068f49d29 /ishtar_common/models.py
parent3ee168dad3aebbd07640420fbdb5136bb909038f (diff)
parent4778f7ab57c5bbd1ec1ff6a0e3bd9e1561ddf454 (diff)
downloadIshtar-87208abf2d2616faad094f33168b491d2a4efcc8.tar.bz2
Ishtar-87208abf2d2616faad094f33168b491d2a4efcc8.zip
Merge branch 'master' into master-trad
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 72a3432f8..5b822c7dd 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -25,6 +25,7 @@ import copy
import datetime
from PIL import Image
from importlib import import_module
+import logging
import os
import re
import shutil
@@ -65,6 +66,9 @@ from ishtar_common.data_importer import Importer, ImportFormater, \
TypeFormater, YearFormater, StrToBoolean, FileFormater
+logger = logging.getLogger(__name__)
+
+
def post_save_user(sender, **kwargs):
user = kwargs['instance']
try:
@@ -95,6 +99,7 @@ class Imported(models.Model):
class ValueGetter(object):
_prefix = ""
GET_VALUES_EXTRA = []
+ EXTRA_FULL_FIELDS_LABELS = {}
def get_values(self, prefix=''):
if not prefix:
@@ -1607,7 +1612,7 @@ def get_importer_models():
('archaeological_context_records.models.RecordRelations',
_(u"Context record relations"))] + MODELS
MODELS = [('archaeological_finds.models.BaseFind',
- _(u"Finds")), ] + MODELS
+ _(u"Base finds")), ] + MODELS
return MODELS
@@ -1995,7 +2000,9 @@ TARGET_MODELS = [
('archaeological_operations.models.OperationType', _(u"Operation type")),
('archaeological_operations.models.Period', _(u"Period")),
('archaeological_operations.models.ReportState', _(u"Report state")),
+ ('archaeological_operations.models.RemainType', _(u"Remain type")),
('archaeological_context_records.models.Unit', _(u"Unit")),
+ ('archaeological_context_records.models.ActivityType', _(u"Activity type")),
('archaeological_finds.models.MaterialType', _(u"Material")),
('archaeological_finds.models.ConservatoryState',
_(u"Conservatory state")),
@@ -2077,7 +2084,9 @@ class FormaterType(models.Model):
kwargs['many_split'] = self.many_split
if self.formater_type == 'TypeFormater':
if self.options not in TARGET_MODELS_KEYS:
- print('%s not in TARGET_MODELS_KEYS' % self.options)
+ logger.warning(
+ "**WARN FormaterType.get_formater_type**: {} "
+ "is not in TARGET_MODELS_KEYS".format(self.options))
return
model = None
if self.options in dir():