update accounting model
This commit is contained in:
		@@ -1,9 +1,10 @@
 | 
				
			|||||||
# -*- coding: utf-8 -*-
 | 
					# -*- 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 __future__ import unicode_literals
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.conf import settings
 | 
					from django.conf import settings
 | 
				
			||||||
from django.db import migrations, models
 | 
					from django.db import migrations, models
 | 
				
			||||||
 | 
					import django.db.models.deletion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Migration(migrations.Migration):
 | 
					class Migration(migrations.Migration):
 | 
				
			||||||
@@ -17,6 +18,6 @@ class Migration(migrations.Migration):
 | 
				
			|||||||
        migrations.AddField(
 | 
					        migrations.AddField(
 | 
				
			||||||
            model_name='accounting',
 | 
					            model_name='accounting',
 | 
				
			||||||
            name='account_user',
 | 
					            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'),
 | 
				
			||||||
        ),
 | 
					        ),
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -85,7 +85,7 @@ class Accounting(models.Model):
 | 
				
			|||||||
    reporter_uuid = models.UUIDField(blank=True, null=True, verbose_name='Reporter UUID')
 | 
					    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_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")
 | 
					    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):
 | 
					    def __str__(self):
 | 
				
			||||||
        return '{}: {} -> {}, {}, {}'.format(self.desk, self.time_from, self.time_to, self.prize, self.billed)
 | 
					        return '{}: {} -> {}, {}, {}'.format(self.desk, self.time_from, self.time_to, self.prize, self.billed)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user