update models
This commit is contained in:
parent
83e77ec81c
commit
e1c94100fb
@ -4,13 +4,31 @@ from django.db import models
|
|||||||
class Location(models.Model):
|
class Location(models.Model):
|
||||||
name = models.CharField(max_length=30, unique=True)
|
name = models.CharField(max_length=30, unique=True)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class Client(models.Model):
|
class Client(models.Model):
|
||||||
id = models.UUIDField(primary_key=True, editable=False)
|
id = models.UUIDField(primary_key=True, editable=False)
|
||||||
location = models.ForeignKey(Location)
|
location = models.ForeignKey(Location)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
|
||||||
class Table(models.Model):
|
class Table(models.Model):
|
||||||
client = models.ForeignKey(Client)
|
client = models.ForeignKey(Client)
|
||||||
number = models.IntegerField()
|
number = models.IntegerField()
|
||||||
name = models.CharField(max_length=30)
|
name = models.CharField(max_length=30)
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.name
|
||||||
|
Loading…
Reference in New Issue
Block a user