forked from expo/troggle
change on_delete to cascade for blocks in a file
This commit is contained in:
parent
838b358a4a
commit
1db7c5ffea
@ -130,6 +130,7 @@ class SurvexBlockLookUpManager(models.Manager):
|
||||
class SurvexBlock(models.Model):
|
||||
"""One begin..end block within a survex file. The basic element of a survey trip.
|
||||
Multiple anonymous survex blocks are possible within the same surfex file
|
||||
Blocks can span several *included survexfile though.
|
||||
"""
|
||||
|
||||
objects = SurvexBlockLookUpManager() # overwrites SurvexBlock.objects and enables lookup()
|
||||
@ -139,8 +140,9 @@ class SurvexBlock(models.Model):
|
||||
|
||||
date = models.DateField(blank=True, null=True)
|
||||
expedition = models.ForeignKey("Expedition", blank=True, null=True, on_delete=models.SET_NULL)
|
||||
|
||||
survexfile = models.ForeignKey("SurvexFile", blank=True, null=True, on_delete=models.SET_NULL)
|
||||
# if the survexfile object is deleted, then all teh suvex-blocks in it should be too,
|
||||
# though a block can span more than one file...
|
||||
survexfile = models.ForeignKey("SurvexFile", blank=True, null=True, on_delete=models.CASCADE)
|
||||
survexpath = models.CharField(max_length=200) # the path for the survex stations
|
||||
|
||||
scanswallet = models.ForeignKey(
|
||||
@ -209,7 +211,8 @@ class SingleScan(models.Model):
|
||||
|
||||
|
||||
class DrawingFile(models.Model):
|
||||
"""A file holding a Therion (several types) or a Tunnel drawing"""
|
||||
"""A file holding a Therion (several types) or a Tunnel drawing
|
||||
Most of the implied capabilities are not implemented yet"""
|
||||
|
||||
dwgpath = models.CharField(max_length=200)
|
||||
dwgname = models.CharField(max_length=200)
|
||||
|
Loading…
Reference in New Issue
Block a user