diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-24 11:06:02 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-01-24 11:06:02 +0100 |
commit | 282186421b25ec64ce4c0559a418bc4bc4ad3ce0 (patch) | |
tree | aa8966766bb6f7b6589612dfaa2132ef6ae12a72 /ishtar_common/models.py | |
parent | a719417c6b94c095d49bcce4d6253f13b2ee5fe5 (diff) | |
parent | 2a8d0c0edb7281e955fd7ad097e205f07cca1d5c (diff) | |
download | Ishtar-282186421b25ec64ce4c0559a418bc4bc4ad3ce0.tar.bz2 Ishtar-282186421b25ec64ce4c0559a418bc4bc4ad3ce0.zip |
Merge branch 'v0.9' into wheezy
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")), ] |