from django.db import models from django.utils import timezone from users.models import User TYPES = ( ('minus', 'Снятие'), ('plus', 'Приход'), ) class InvoiceHistory(models.Model): comment = models.TextField(blank=True) created = models.DateTimeField(default=timezone.now) sum = models.DecimalField(max_digits=10, decimal_places=0, default=0, null=True, blank=True) type = models.CharField(max_length=20) user = models.ForeignKey(User, related_name='invoice_history') def __str__(self): return self.pk class Meta: verbose_name = 'Счет(История)' verbose_name_plural = 'Счет(История)'