parent
57a8375c5c
commit
151a96dc37
@ -0,0 +1,86 @@
|
||||
# Generated by Django 5.1.4 on 2025-01-07 15:19
|
||||
|
||||
import django.contrib.auth.models
|
||||
import django.contrib.auth.validators
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auth', '0012_alter_user_first_name_max_length'),
|
||||
('inventory', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Contractor',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Наименование контрагента')),
|
||||
('address', models.TextField(verbose_name='Адрес')),
|
||||
('phone', models.CharField(max_length=20, verbose_name='Телефон')),
|
||||
('email', models.EmailField(max_length=254, verbose_name='Электронная почта')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Position',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255, verbose_name='Наименование должности')),
|
||||
('hourly_rate', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Ставка в час')),
|
||||
('monthly_hours', models.IntegerField(verbose_name='Часы в месяц')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Truck',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('plate_number', models.CharField(max_length=20, verbose_name='Номерной знак')),
|
||||
('model', models.CharField(max_length=50, verbose_name='Модель')),
|
||||
('capacity', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Грузоподъемность (тонны)')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Employee',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('password', models.CharField(max_length=128, verbose_name='password')),
|
||||
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
|
||||
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
|
||||
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
|
||||
('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
|
||||
('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
|
||||
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
|
||||
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
|
||||
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
|
||||
('department', models.CharField(max_length=255, verbose_name='Подразделение')),
|
||||
('work_phone', models.CharField(blank=True, max_length=20, null=True, verbose_name='Рабочий телефон')),
|
||||
('personal_phone', models.CharField(blank=True, max_length=20, null=True, verbose_name='Личный телефон')),
|
||||
('email', models.EmailField(max_length=254, unique=True, verbose_name='Электронная почта')),
|
||||
('groups', models.ManyToManyField(blank=True, related_name='employee_groups', to='auth.group', verbose_name='Группы')),
|
||||
('user_permissions', models.ManyToManyField(blank=True, related_name='employee_permissions', to='auth.permission', verbose_name='Разрешения')),
|
||||
('position', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.position', verbose_name='Должность')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'user',
|
||||
'verbose_name_plural': 'users',
|
||||
'abstract': False,
|
||||
},
|
||||
managers=[
|
||||
('objects', django.contrib.auth.models.UserManager()),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SupplyContract',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('description', models.TextField(verbose_name='Описание')),
|
||||
('start_date', models.DateField(verbose_name='Дата начала')),
|
||||
('end_date', models.DateField(blank=True, null=True, verbose_name='Дата окончания')),
|
||||
('contractor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.contractor', verbose_name='Контрагент')),
|
||||
],
|
||||
),
|
||||
]
|
@ -1,4 +1,6 @@
|
||||
from .base import *
|
||||
|
||||
DEBUG = True
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
INSTALLED_APPS.append("drf_yasg")
|
||||
|
Loading…
Reference in new issue