summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2014-05-12 21:21:04 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2014-05-12 21:23:12 +0200
commit18a6ad99164350af62d65efd6a1fd1aa4c419739 (patch)
treee69bfd5b3bc0843ec93223dc12d4a376d6b489c0 /archaeological_finds
parent6d05b2d357c15b9d291922ac67fecebe3208b55f (diff)
downloadIshtar-18a6ad99164350af62d65efd6a1fd1aa4c419739.tar.bz2
Ishtar-18a6ad99164350af62d65efd6a1fd1aa4c419739.zip
Person and organization deletion (refs #1675)
* add associated actions, wizards, forms * prevent deletion of associted items (operations, files, etc.) * give list of associated items before deletion and give access to these items
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/archaeological_finds/models.py b/archaeological_finds/models.py
index 53af78f8b..592788b88 100644
--- a/archaeological_finds/models.py
+++ b/archaeological_finds/models.py
@@ -330,7 +330,8 @@ class Treatment(BaseHistorizedItem, OwnPerms):
location = models.ForeignKey(Warehouse, verbose_name=_(u"Location"),
blank=True, null=True)
person = models.ForeignKey(Person, verbose_name=_(u"Person"),
- blank=True, null=True)
+ blank=True, null=True, on_delete=models.SET_NULL,
+ related_name='treatments')
start_date = models.DateField(_(u"Start date"), blank=True, null=True)
end_date = models.DateField(_(u"End date"), blank=True, null=True)
history = HistoricalRecords()
@@ -367,7 +368,8 @@ class Property(LightHistorizedItem):
find = models.ForeignKey(Find, verbose_name=_(u"Find"))
administrative_act = models.ForeignKey(AdministrativeAct,
verbose_name=_(u"Administrative act"))
- person = models.ForeignKey(Person, verbose_name=_(u"Person"))
+ person = models.ForeignKey(Person, verbose_name=_(u"Person"),
+ related_name='properties')
start_date = models.DateField(_(u"Start date"))
end_date = models.DateField(_(u"End date"))