From d76e615b338dcba7569ffa2e9cf3664bcc12d8d4 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 16 Dec 2016 20:39:53 +0000 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abonapp/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/abonapp/models.py b/abonapp/models.py index 61340a1..a6241cb 100644 --- a/abonapp/models.py +++ b/abonapp/models.py @@ -5,7 +5,6 @@ from django.shortcuts import get_object_or_404 from django.utils import timezone from django.utils.datetime_safe import datetime from django.db import models -from django.conf import settings from django.core.validators import DecimalValidator from agent import get_TransmitterClientKlass, NetExcept @@ -29,6 +28,7 @@ class LogicError(Exception): class AbonGroup(models.Model): title = models.CharField(max_length=127, unique=True) + profiles = models.ManyToManyField(UserProfile, related_name='abon_groups') class Meta: db_table = 'abonent_groups' @@ -40,7 +40,7 @@ class AbonGroup(models.Model): class AbonLog(models.Model): abon = models.ForeignKey('Abon') amount = models.FloatField(default=0.0) - author = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='+') + author = models.ForeignKey(UserProfile, related_name='+') comment = models.CharField(max_length=128) date = models.DateTimeField(auto_now_add=True) @@ -310,7 +310,7 @@ class InvoiceForPayment(models.Model): comment = models.CharField(max_length=128) date_create = models.DateTimeField(auto_now_add=True) date_pay = models.DateTimeField(blank=True, null=True) - author = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='+') + author = models.ForeignKey(UserProfile, related_name='+') def __unicode__(self): return "%s -> %d $" % (self.abon.username, self.amount)