update accounting model

This commit is contained in:
Robert Einsle 2017-04-26 10:14:49 +02:00
parent 6135c7c61a
commit 55cf6101a8
2 changed files with 4 additions and 3 deletions

View File

@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-26 09:57
# Generated by Django 1.11 on 2017-04-26 10:14
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
@ -17,6 +18,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='accounting',
name='account_user',
field=models.ManyToManyField(related_name='accountings', to=settings.AUTH_USER_MODEL, verbose_name='Abr. Benutzer'),
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='accountings', to=settings.AUTH_USER_MODEL, verbose_name='Abr. Benutzer'),
),
]

View File

@ -85,7 +85,7 @@ class Accounting(models.Model):
reporter_uuid = models.UUIDField(blank=True, null=True, verbose_name='Reporter UUID')
prize_normal = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True, verbose_name="Preis Normalzeit")
prize_hh = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True, verbose_name="Preis Happy Hour")
account_user = models.ManyToManyField(User, related_name='accountings', verbose_name="Abr. Benutzer")
account_user = models.OneToOneField(User, related_name='accountings', verbose_name="Abr. Benutzer", blank=True, null=True)
def __str__(self):
return '{}: {} -> {}, {}, {}'.format(self.desk, self.time_from, self.time_to, self.prize, self.billed)