Models
This commit is contained in:
parent
cbf998569a
commit
8c8acd3e19
20
apps/account/migrations/0024_role_establishment_subtype.py
Normal file
20
apps/account/migrations/0024_role_establishment_subtype.py
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Generated by Django 2.2.7 on 2019-12-06 06:55
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('establishment', '0067_auto_20191122_1244'),
|
||||||
|
('account', '0023_auto_20191204_0916'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='role',
|
||||||
|
name='establishment_subtype',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='establishment.EstablishmentSubType', verbose_name='Establishment subtype'),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
"""Account models"""
|
"""Account models"""
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from tabnanny import verbose
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.auth.models import AbstractUser, UserManager as BaseUserManager
|
from django.contrib.auth.models import AbstractUser, UserManager as BaseUserManager
|
||||||
|
|
@ -15,7 +16,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from rest_framework.authtoken.models import Token
|
from rest_framework.authtoken.models import Token
|
||||||
|
|
||||||
from authorization.models import Application
|
from authorization.models import Application
|
||||||
from establishment.models import Establishment
|
from establishment.models import Establishment, EstablishmentSubType
|
||||||
from location.models import Country
|
from location.models import Country
|
||||||
from main.models import SiteSettings
|
from main.models import SiteSettings
|
||||||
from utils.models import GMTokenGenerator
|
from utils.models import GMTokenGenerator
|
||||||
|
|
@ -54,6 +55,9 @@ class Role(ProjectBaseMixin):
|
||||||
null=True, blank=True, on_delete=models.SET_NULL)
|
null=True, blank=True, on_delete=models.SET_NULL)
|
||||||
site = models.ForeignKey(SiteSettings, verbose_name=_('Site settings'),
|
site = models.ForeignKey(SiteSettings, verbose_name=_('Site settings'),
|
||||||
null=True, blank=True, on_delete=models.SET_NULL)
|
null=True, blank=True, on_delete=models.SET_NULL)
|
||||||
|
establishment_subtype = models.ForeignKey(EstablishmentSubType,
|
||||||
|
verbose_name=_('Establishment subtype'),
|
||||||
|
null=True, blank=True, on_delete=models.SET_NULL)
|
||||||
|
|
||||||
|
|
||||||
class UserManager(BaseUserManager):
|
class UserManager(BaseUserManager):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user