diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-24 11:00:36 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-24 11:00:36 +0100 |
commit | 2a8d0c0edb7281e955fd7ad097e205f07cca1d5c (patch) | |
tree | db3e5e1d57ccf4684df9289242f62ae6597d76b0 /ishtar_common/models.py | |
parent | ac595e9aa13d27fb15e70eb1f6e2d11f928a4c4a (diff) | |
parent | 3fbc69487b0fde33bb78f8d92da8eac25cb5da2e (diff) | |
download | Ishtar-2a8d0c0edb7281e955fd7ad097e205f07cca1d5c.tar.bz2 Ishtar-2a8d0c0edb7281e955fd7ad097e205f07cca1d5c.zip |
Merge branch 'master' into v0.9
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index d58d549c8..d1d58f184 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -959,11 +959,12 @@ def post_delete_record_relation(sender, instance, **kwargs): # no symetric/inverse is defined if not sym_rel_type: return - - dct = {'right_record': instance.left_record, - 'left_record': instance.right_record, + dct = {'right_record_id': instance.left_record_id, + 'left_record_id': instance.right_record_id, 'relation_type': sym_rel_type} - instance.__class__.objects.filter(**dct).delete() + q = instance.__class__.objects.filter(**dct) + if q.count(): + q.delete() class ShortMenuItem(object): @@ -2048,10 +2049,13 @@ TARGET_MODELS = [ _(u"Conservatory state")), ('archaeological_finds.models.PreservationType', _(u"Preservation type")), ('archaeological_finds.models.ObjectType', _(u"Object type")), + ('archaeological_finds.models.IntegrityType', _(u"Integrity type")), + ('archaeological_finds.models.RemarkabilityType', _(u"Remarkability type")), ('archaeological_context_records.models.IdentificationType', _("Identification type")), ('archaeological_context_records.models.RelationType', _(u"Context record relation type")), + ('SpatialReferenceSystem', _(u"Spatial reference system")), ('SupportType', _(u"Support type")), ] |