update data model

This commit is contained in:
2017-02-01 17:52:16 +01:00
parent 616fd63bfc
commit 48a912f04b
3 changed files with 10 additions and 7 deletions

View File

@@ -1,3 +1,4 @@
import uuid
from django.db import models
@@ -34,7 +35,7 @@ class Location(models.Model):
class Client(models.Model):
id = models.UUIDField(primary_key=True, editable=False)
uuid = models.UUIDField(unique=True, default=uuid.uuid4)
location = models.ForeignKey(Location)
desk1_enable = models.BooleanField()
desk1_name = models.CharField(max_length=32, blank=True, null=True)
@@ -46,7 +47,7 @@ class Client(models.Model):
desk2_prize_ht = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
def __str__(self):
return self.name
return self.location.name
def __unicode__(self):
return self.name
return self.location.name