From 78e9993e933b00da8cd79d9bc65a94257188cbcb Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 6 Feb 2019 15:31:06 +0100 Subject: ForeignKey: SET_NULL fix --- archaeological_finds/models_treatments.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'archaeological_finds/models_treatments.py') diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index a1e0a0437..041721d68 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -138,6 +138,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, index = models.IntegerField(_(u"Index"), default=1) file = models.ForeignKey( 'TreatmentFile', related_name='treatments', blank=True, null=True, + on_delete=models.SET_NULL, verbose_name=_(u"Associated request")) treatment_types = models.ManyToManyField( TreatmentType, verbose_name=_(u"Treatment type")) @@ -149,6 +150,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, _(u"Treatment have been executed"), default=False) location = models.ForeignKey( Warehouse, verbose_name=_(u"Location"), blank=True, null=True, + on_delete=models.SET_NULL, help_text=_( u"Location where the treatment is done. Target warehouse for " u"a move.")) @@ -167,6 +169,7 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem, end_date = models.DateField(_(u"Closing date"), blank=True, null=True) creation_date = models.DateTimeField(default=datetime.datetime.now) container = models.ForeignKey(Container, verbose_name=_(u"Container"), + on_delete=models.SET_NULL, blank=True, null=True) estimated_cost = models.FloatField(_(u"Estimated cost"), blank=True, null=True) -- cgit v1.2.3