diff options
author | Étienne Loks <etienne@peacefrogs.net> | 2019-02-06 15:31:06 +0100 |
---|---|---|
committer | Étienne Loks <etienne@peacefrogs.net> | 2019-02-06 15:31:06 +0100 |
commit | 4dc674ea9fa7516878a7b128da10ca9f09a6a1c7 (patch) | |
tree | 996f49e49c31c5c6644905ee3d9a3bf30da3bd1f /archaeological_finds/models_finds.py | |
parent | 4cbb3429c3243e93597c2d2fbc668b444499c728 (diff) | |
download | Ishtar-4dc674ea9fa7516878a7b128da10ca9f09a6a1c7.tar.bz2 Ishtar-4dc674ea9fa7516878a7b128da10ca9f09a6a1c7.zip |
ForeignKey: SET_NULL fix
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r-- | archaeological_finds/models_finds.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 1bc774aa2..ad15aea88 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -284,6 +284,7 @@ class BaseFind(BulkUpdatedItem, BaseHistorizedItem, OwnPerms): discovery_date_taq = models.DateField(_(u"Discovery date (TAQ)"), blank=True, null=True) batch = models.ForeignKey(BatchType, verbose_name=_(u"Batch/object"), + on_delete=models.SET_NULL, blank=True, null=True) index = models.IntegerField(u"Index", default=0) material_index = models.IntegerField(_(u"Material index"), default=0) @@ -301,6 +302,7 @@ class BaseFind(BulkUpdatedItem, BaseHistorizedItem, OwnPerms): blank=True, null=True) spatial_reference_system = models.ForeignKey( SpatialReferenceSystem, verbose_name=_(u"Spatial Reference System"), + on_delete=models.SET_NULL, blank=True, null=True) point_2d = models.PointField(_(u"Point (2D)"), blank=True, null=True) point = models.PointField(_(u"Point (3D)"), blank=True, null=True, dim=3) @@ -1097,6 +1099,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, material_type_quality = models.ForeignKey( MaterialTypeQualityType, verbose_name=_(u"Material type quality"), related_name='finds', + on_delete=models.SET_NULL, blank=True, null=True ) volume = models.FloatField(_(u"Volume (l)"), blank=True, null=True) @@ -1131,7 +1134,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, object_type_quality = models.ForeignKey( ObjectTypeQualityType, verbose_name=_(u"Object type quality"), related_name='finds', - blank=True, null=True + on_delete=models.SET_NULL, blank=True, null=True ) integrities = models.ManyToManyField( IntegrityType, verbose_name=_(u"Integrity / interest"), @@ -1166,6 +1169,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, previous_id = models.TextField(_(u"Previous ID"), blank=True, null=True) index = models.IntegerField(u"Index", default=0) checked_type = models.ForeignKey(CheckedType, verbose_name=_(u"Check"), + on_delete=models.SET_NULL, blank=True, null=True) check_date = models.DateField(_(u"Check date"), default=datetime.date.today) @@ -1195,6 +1199,7 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, ) treatment_emergency = models.ForeignKey( TreatmentEmergencyType, verbose_name=_(u"Treatment emergency"), + on_delete=models.SET_NULL, blank=True, null=True ) insurance_value = models.FloatField(_(u"Insurance value"), blank=True, |