From 67dba65b43591eede645f8a1271c2e46a04b993b Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 23 Dec 2014 09:02:27 +0100 Subject: [PATCH] Add DuckName and DuckNameVote models --- booking/models.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/booking/models.py b/booking/models.py index 2dbba09..42f7e45 100644 --- a/booking/models.py +++ b/booking/models.py @@ -50,6 +50,24 @@ class Duck(models.Model): return self.name +class DuckName(models.Model): + """Model to hold name suggestions for Ducks""" + + duck = models.ForeignKey(Duck) + name = models.CharField(max_length = 60) + suggested_by = models.ForeignKey(User) + suggested_at = models.DateTimeField(default = timezone.now) + closed_by = models.ForeignKey(User, related_name = '+') + closed_at = models.DateTimeField(null = True) + +class DuckNameVote(models.Model): + """Model to hold votes to Duck names""" + + duck_name = models.ForeignKey(DuckName) + vote_timestamp = models.DateTimeField(default = timezone.now) + voter = models.ForeignKey(User) + upvote = models.BooleanField(default = True) + class DuckCompetence(models.Model): """Duck competence governor table"""