Add unique together for model
This commit is contained in:
parent
f3bed03d8f
commit
6b83a1ff0d
3 changed files with 38 additions and 0 deletions
|
@ -55,6 +55,8 @@ class UserRoom(models.Model):
|
|||
)
|
||||
last_seen = models.DateTimeField(verbose_name=_("last seen"), auto_now_add=True)
|
||||
|
||||
class Meta:
|
||||
unique_together = ("user", "room")
|
||||
|
||||
class Ignore(models.Model):
|
||||
user = models.OneToOneField(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue