fix model dependencies

This commit is contained in:
Robert Einsle 2018-02-11 10:59:45 +01:00
parent d9d78a969f
commit 64d38dfcd8
2 changed files with 34 additions and 3 deletions

View File

@ -0,0 +1,31 @@
# Generated by Django 2.0.2 on 2018-02-11 10:59
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('billard', '0024_auto_20180210_1105'),
]
operations = [
migrations.AlterField(
model_name='accounting',
name='desk',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='billard.Desk',
verbose_name='Tisch'),
),
migrations.AlterField(
model_name='client',
name='location',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='clients',
to='billard.Location', verbose_name='Standort'),
),
migrations.AlterField(
model_name='desk',
name='client',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='desks',
to='billard.Client', verbose_name='Client'),
),
]

View File

@ -49,7 +49,7 @@ class Location(models.Model):
class Client(models.Model):
uuid = models.UUIDField(unique=True, default=uuid.uuid4, verbose_name="Identifier")
location = models.ForeignKey(Location, related_name="clients", verbose_name="Standort", on_delete=models.DO_NOTHING)
location = models.ForeignKey(Location, related_name="clients", verbose_name="Standort", on_delete=models.CASCADE)
report_user = models.ForeignKey(User, blank=True, null=True, verbose_name="Reporting Benutzer",
related_name='reporting_clients', on_delete=models.DO_NOTHING)
@ -62,7 +62,7 @@ class Client(models.Model):
class Desk(models.Model):
client = models.ForeignKey(Client, verbose_name='Client', related_name='desks', on_delete=models.DO_NOTHING)
client = models.ForeignKey(Client, verbose_name='Client', related_name='desks', on_delete=models.CASCADE)
desk_no = models.IntegerField(verbose_name='Tischnummer')
name = models.CharField(max_length=32, blank=True, null=True, verbose_name='Tischbezeichnung')
enabled = models.BooleanField(verbose_name='Tisch aktiv')
@ -79,7 +79,7 @@ class Desk(models.Model):
class Accounting(models.Model):
desk = models.ForeignKey(Desk, verbose_name="Tisch", on_delete=models.DO_NOTHING)
desk = models.ForeignKey(Desk, verbose_name="Tisch", on_delete=models.CASCADE)
time_from = models.DateTimeField(verbose_name="Beginn")
time_to = models.DateTimeField(blank=True, null=True, verbose_name="Ende")
prize = models.DecimalField(max_digits=6, decimal_places=2, blank=True, null=True, verbose_name="Preis")