summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_finds/models_finds.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 61eb5167c..9a7a71f84 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -397,7 +397,7 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
MaterialType, verbose_name=_(u"Material types"), related_name='finds')
conservatory_state = models.ForeignKey(
ConservatoryState, verbose_name=_(u"Conservatory state"), blank=True,
- null=True)
+ null=True, on_delete=models.SET_NULL)
conservatory_comment = models.TextField(_(u"Conservatory comment"),
blank=True, null=True)
preservation_to_considers = models.ManyToManyField(
@@ -407,19 +407,19 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
weight = models.FloatField(_(u"Weight (g)"), blank=True, null=True)
weight_unit = models.CharField(_(u"Weight unit"), max_length=4,
blank=True, null=True, choices=WEIGHT_UNIT)
- find_number = models.IntegerField(_("Find number"), blank=True, null=True)
+ find_number = models.IntegerField(_(u"Find number"), blank=True, null=True)
upstream_treatment = models.ForeignKey(
"Treatment", blank=True, null=True,
- related_name='downstream',
- verbose_name=_("Upstream treatment"))
+ related_name='downstream', on_delete=models.SET_NULL,
+ verbose_name=_(u"Upstream treatment"))
downstream_treatment = models.ForeignKey(
"Treatment", blank=True, null=True, related_name='upstream',
- verbose_name=_("Downstream treatment"))
+ verbose_name=_(u"Downstream treatment"), on_delete=models.SET_NULL)
datings = models.ManyToManyField(Dating, verbose_name=_(u"Dating"),
related_name='find')
container = models.ForeignKey(
Container, verbose_name=_(u"Container"), blank=True, null=True,
- related_name='finds')
+ related_name='finds', on_delete=models.SET_NULL)
is_complete = models.NullBooleanField(_(u"Is complete?"), blank=True,
null=True)
object_types = models.ManyToManyField(
@@ -454,8 +454,9 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
default=datetime.date.today)
estimated_value = models.FloatField(_(u"Estimated value"), blank=True,
null=True)
- collection = models.ForeignKey(Collection, verbose_name=_(u"Collection"),
- blank=True, null=True, related_name='finds')
+ collection = models.ForeignKey(
+ Collection, verbose_name=_(u"Collection"), blank=True, null=True,
+ related_name='finds', on_delete=models.SET_NULL)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True)
history = HistoricalRecords()
BASKET_MODEL = FindBasket