diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-05-13 09:46:11 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-05-13 09:46:11 +0200 |
commit | 2dd330bcaa1a749b410125cc1152f58fb5ec4313 (patch) | |
tree | 08f6579da7f70fd9ad44ab9307c422f09e00e8fa /ishtar_common/models.py | |
parent | 0d4f06d918dd82212403d41b9d88a53080ba724e (diff) | |
download | Ishtar-2dd330bcaa1a749b410125cc1152f58fb5ec4313.tar.bz2 Ishtar-2dd330bcaa1a749b410125cc1152f58fb5ec4313.zip |
Imports: fix unique for target value - better error msg for generic formset - fix type import for ishtar_common
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index e79eb4253..7514239bd 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -989,6 +989,8 @@ def get_model_fields(model): def import_class(full_path_classname): mods = full_path_classname.split('.') + if len(mods) == 1: + mods = ['ishtar_common', 'models', mods[0]] module = import_module('.'.join(mods[:-1])) return getattr(module, mods[-1]) @@ -1197,7 +1199,7 @@ class TargetKey(models.Model): is_set = models.BooleanField(_(u"Is set"), default=False) class Meta: - unique_together = ('target', 'value') + unique_together = ('target', 'key') def __unicode__(self): return u" - ".join([unicode(self.target), self.key[:50]]) |