mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 12:27:05 +00:00
CASCADE fixes in data model
This commit is contained in:
@@ -59,6 +59,9 @@ class Area(TroggleModel):
|
||||
|
||||
|
||||
class CaveAndEntrance(models.Model):
|
||||
"""CASCADE means that if the cave or the entrance is deleted, then this CaveAndEntrance
|
||||
is deleted too
|
||||
"""
|
||||
cave = models.ForeignKey("Cave", on_delete=models.CASCADE)
|
||||
entrance = models.ForeignKey("Entrance", on_delete=models.CASCADE)
|
||||
entrance_letter = models.CharField(max_length=20, blank=True, null=True)
|
||||
@@ -240,6 +243,8 @@ class Cave(TroggleModel):
|
||||
|
||||
|
||||
class EntranceSlug(models.Model):
|
||||
"""If the Entrance is deleted, then this EntranceSlug is deleted too
|
||||
"""
|
||||
entrance = models.ForeignKey("Entrance", on_delete=models.CASCADE)
|
||||
slug = models.SlugField(max_length=50, unique=True)
|
||||
primary = models.BooleanField(default=False)
|
||||
|
||||
Reference in New Issue
Block a user