Added metadata to models
This commit is contained in:
		@@ -6,41 +6,42 @@ from . import utils
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
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)
 | 
			
		||||
    location_id = models.CharField(max_length=32, blank=False, null=False, name="Standort-ID")
 | 
			
		||||
    table_no = models.IntegerField(blank=False, null=False, name="Tischnummer")
 | 
			
		||||
    tst = models.DateTimeField(blank=False, null=False, name="Zeitstempel")
 | 
			
		||||
    on_off = models.BooleanField(blank=False, null=False, name="Ein/Ausgebucht")
 | 
			
		||||
    processed = models.BooleanField(default=False, name="Verarbeitet")
 | 
			
		||||
    error_msg = models.CharField(max_length=16000, blank=True, null=True, name="Fehlermeldung")
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return str(self.location_id)
 | 
			
		||||
 | 
			
		||||
    def __unicode__(self):
 | 
			
		||||
        return str(self.location_id)
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        verbose_name = "Standortlog"
 | 
			
		||||
        verbose_name_plural = "Standortlogs"
 | 
			
		||||
 | 
			
		||||
class Location(models.Model):
 | 
			
		||||
    users = models.ManyToManyField(User, related_name='locations')
 | 
			
		||||
    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)
 | 
			
		||||
    users = models.ManyToManyField(User, related_name='locations', name="Benutzer")
 | 
			
		||||
    code = models.CharField(max_length=16, unique=True, name="Code")
 | 
			
		||||
    name = models.CharField(max_length=64, unique=True, name="Name")
 | 
			
		||||
    street = models.CharField(max_length=64, blank=True, null=True, name="Straße")
 | 
			
		||||
    plz = models.CharField(max_length=8, blank=True, null=True, name="Postleitzahl")
 | 
			
		||||
    city = models.CharField(max_length=64, blank=True, null=True, name="Stadt")
 | 
			
		||||
    phone = models.CharField(max_length=64, blank=True, null=True, name="Telefon")
 | 
			
		||||
    email = models.EmailField(blank=True, null=True, name="Email")
 | 
			
		||||
    url = models.URLField(blank=True,null=True, name="URL")
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return self.name
 | 
			
		||||
 | 
			
		||||
    def __unicode__(self):
 | 
			
		||||
        return self.name
 | 
			
		||||
    class Meta:
 | 
			
		||||
        verbose_name = "Standort"
 | 
			
		||||
        verbose_name_plural = "Standorte"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class Client(models.Model):
 | 
			
		||||
    uuid = models.UUIDField(unique=True, default=uuid.uuid4)
 | 
			
		||||
    location = models.ForeignKey(Location)
 | 
			
		||||
    uuid = models.UUIDField(unique=True, default=uuid.uuid4, name="Identifier")
 | 
			
		||||
    location = models.ForeignKey(Location, name="Standort")
 | 
			
		||||
    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)
 | 
			
		||||
@@ -68,22 +69,21 @@ class Client(models.Model):
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return '{}, {}'.format(self.location.name, self.uuid)
 | 
			
		||||
 | 
			
		||||
    def __unicode__(self):
 | 
			
		||||
        return '{}, {}'.format(self.location.name, self.uuid)
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        verbose_name = "Client"
 | 
			
		||||
        verbose_name_plural = "Clienten"
 | 
			
		||||
 | 
			
		||||
class Accounting(models.Model):
 | 
			
		||||
    client = models.ForeignKey(Client)
 | 
			
		||||
    desk_no = models.IntegerField()
 | 
			
		||||
    time_from = models.DateTimeField()
 | 
			
		||||
    time_to = models.DateTimeField(blank=True, null=True)
 | 
			
		||||
    prize = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True)
 | 
			
		||||
    client = models.ForeignKey(Client, name="Client")
 | 
			
		||||
    desk_no = models.IntegerField(name="Tischnummer")
 | 
			
		||||
    time_from = models.DateTimeField(name="Beginn")
 | 
			
		||||
    time_to = models.DateTimeField(blank=True, null=True, name="Ende")
 | 
			
		||||
    prize = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True, name="Preis")
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return '{}: {} -> {}, {}'.format(self.client.uuid, self.time_from, self.time_to, self.prize)
 | 
			
		||||
 | 
			
		||||
    def __unicode__(self):
 | 
			
		||||
        return '{}: {} -> {}, {}'.format(self.client.uuid, self.time_from, self.time_to, self.prize)
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        ordering = ['-time_from']
 | 
			
		||||
        verbose_name = "Buchhaltungseintrag"
 | 
			
		||||
        verbose_name_plural = "Buchhaltungseinträge"
 | 
			
		||||
		Reference in New Issue
	
	Block a user