summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 14c459ace..57d5a7e5e 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -59,7 +59,7 @@ from ishtar_common.model_merging import merge_model_objects
from ishtar_common.utils import get_cache
from ishtar_common.data_importer import Importer, ImportFormater, \
IntegerFormater, FloatFormater, UnicodeFormater, DateFormater, \
- TypeFormater, YearFormater
+ TypeFormater, YearFormater, StrToBoolean
def post_save_user(sender, **kwargs):
user = kwargs['instance']
@@ -992,6 +992,10 @@ if 'archaeological_context_records' in settings.INSTALLED_APPS:
MODELS = [('archaeological_context_records.models.ContextRecord',
_(u"Context records")),
] + MODELS
+if 'archaeological_finds' in settings.INSTALLED_APPS:
+ MODELS = [('archaeological_finds.models.BaseFind',
+ _(u"Finds")),
+ ] + MODELS
def get_model_fields(model):
"""
@@ -1272,6 +1276,7 @@ IMPORTER_TYPES = (
('DateFormater', _(u"Date")),
('TypeFormater', _(u"Type")),
('YearFormater', _(u"Year")),
+ ('StrToBoolean', _(u"String to boolean")),
)
IMPORTER_TYPES_DCT = {
@@ -1281,6 +1286,7 @@ IMPORTER_TYPES_DCT = {
'DateFormater':DateFormater,
'TypeFormater':TypeFormater,
'YearFormater':YearFormater,
+ 'StrToBoolean':StrToBoolean,
}
DATE_FORMATS = (
@@ -1337,6 +1343,8 @@ class FormaterType(models.Model):
return
elif self.formater_type == 'DateFormater':
return DateFormater(self.options, **kwargs)
+ elif self.formater_type == 'StrToBoolean':
+ return StrToBoolean(**kwargs)
else:
return IMPORTER_TYPES_DCT[self.formater_type](**kwargs)