carom-server/billard/models.py
2017-02-01 13:52:30 +01:00

53 lines
2.0 KiB
Python

from django.db import models
class LocationData(models.Model):
location_id = models.CharField(max_length=32, blank=False, null=False)
table_no = models.IntegerField(blank=False, null=False)
tst = models.DateTimeField(blank=False, null=False)
on_off = models.BooleanField(blank=False, null=False)
processed = models.BooleanField(default=False)
error_msg = models.CharField(max_length=16000, blank=True, null=True)
def __str__(self):
return str(self.location_id)
def __unicode__(self):
return str(self.location_id)
class Location(models.Model):
code = models.CharField(max_length=16, unique=True)
name = models.CharField(max_length=64, unique=True)
street = models.CharField(max_length=64, blank=True, null=True)
plz = models.CharField(max_length=8, blank=True, null=True)
city = models.CharField(max_length=64, blank=True, null=True)
phone = models.CharField(max_length=64, blank=True, null=True)
email = models.EmailField(blank=True, null=True)
url = models.URLField(blank=True,null=True)
def __str__(self):
return self.name
def __unicode__(self):
return self.name
class Client(models.Model):
id = models.UUIDField(primary_key=True, editable=False)
location = models.ForeignKey(Location)
desk1_enable = models.BooleanField()
desk1_name = models.CharField(max_length=32, blank=True, null=True)
desk1_prize_nt = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
desk1_prize_ht = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
desk2_enable = models.BooleanField()
desk2_name = models.CharField(max_length=32, blank=True, null=True)
desk2_prize_nt = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
desk2_prize_ht = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
def __str__(self):
return self.name
def __unicode__(self):
return self.name