Commit e109657a authored by Benjamin Graillot's avatar Benjamin Graillot

[activity] Disallow deletion of some models

parent 7ee5b23a
......@@ -9,15 +9,15 @@ class ActivityType(models.Model):
class Activity(models.Model):
name = models.CharField(max_length=255)
description = models.TextField()
type = models.ForeignKey(ActivityType, null=True, on_delete=models.SET_NULL, related_name='+')
organizer = models.ForeignKey('member.Club', null=True, on_delete=models.SET_NULL, related_name='+')
attendees_club = models.ForeignKey('member.Club', null=True, on_delete=models.SET_NULL, related_name='+')
type = models.ForeignKey(ActivityType, on_delete=models.PROTECT, related_name='+')
organizer = models.ForeignKey('member.Club', on_delete=models.PROTECT, related_name='+')
attendees_club = models.ForeignKey('member.Club', on_delete=models.PROTECT, related_name='+')
date_start = models.DateTimeField()
date_end = models.DateTimeField()
class Guest(models.Model):
activity = models.ForeignKey(Activity, null=True, on_delete=models.SET_NULL, related_name='+')
activity = models.ForeignKey(Activity, on_delete=models.PROTECT, related_name='+')
name = models.CharField(max_length=255)
inviter = models.ForeignKey('member.User', null=True, on_delete=models.SET_NULL, related_name='+')
inviter = models.ForeignKey('member.User', on_delete=models.PROTECT, related_name='+')
entry = models.DateTimeField(null=True)
entry_transaction = models.ForeignKey('note.Transaction', null=True, on_delete=models.SET_NULL)
entry_transaction = models.ForeignKey('note.Transaction', on_delete=models.PROTECT)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment