duck-booking-tool/booking/models.py

29 lines
728 B
Python
Raw Normal View History

2014-12-22 13:22:38 +00:00
from django.db import models
2014-12-22 13:24:10 +00:00
from django.contrib.auth.models import User
2014-12-22 13:22:38 +00:00
class Species(models.Model):
"""Model to hold the Ducks species"""
name = models.CharField(max_length = 40, unique = True)
def __str__(self):
return self.name
2014-12-22 13:52:17 +00:00
class Location(models.Model):
"""Model to hold the possible locations of the Ducks"""
name = models.CharField(max_length = 50)
def __str__(self):
return self.name
2014-12-22 13:24:10 +00:00
class Competence(models.Model):
"""Model to hold Duck competences"""
name = models.CharField(max_length = 255, unique = True)
added_at = models.DateTimeField(default = timezone.now)
added_by = models.ForeignKey(User)
def __str__(self):
return self.name