diff --git a/custom_user/migrations/0001_initial.py b/custom_user/migrations/0001_initial.py new file mode 100644 index 0000000..3f60484 --- /dev/null +++ b/custom_user/migrations/0001_initial.py @@ -0,0 +1,48 @@ +# Generated by Django 4.2.5 on 2023-09-28 22:09 + +import custom_user.services +import custom_user.user_manager +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ('auth', '0012_alter_user_first_name_max_length'), + ] + + operations = [ + migrations.CreateModel( + name='CustomUser', + 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')), + ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')), + ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')), + ('first_name', models.CharField(blank=True, max_length=150, null=True, verbose_name='Имя')), + ('last_name', models.CharField(blank=True, max_length=150, null=True, verbose_name='Фамилия')), + ('patronymic', models.CharField(blank=True, max_length=150, null=True, verbose_name='Отчество')), + ('phone', models.CharField(blank=True, max_length=20, null=True, verbose_name='Телефон')), + ('shop_name', models.CharField(blank=True, max_length=200, null=True, verbose_name='Название магазина')), + ('shop_preview', models.ImageField(blank=True, null=True, upload_to=custom_user.services.shop_preview_upload_path, verbose_name='Превью магазина')), + ('email', models.EmailField(max_length=254, unique=True, verbose_name='Email')), + ('is_active', models.BooleanField(default=True, verbose_name='Статус активации')), + ('is_seller', models.BooleanField(choices=[(0, 'Посетитель'), (1, 'Продавец')], default=0, verbose_name='Статус клиента')), + ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups')), + ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions')), + ], + options={ + 'verbose_name': 'user', + 'verbose_name_plural': 'users', + 'abstract': False, + }, + managers=[ + ('objects', custom_user.user_manager.CustomUserManager()), + ], + ), + ] diff --git a/products/migrations/0001_initial.py b/products/migrations/0001_initial.py new file mode 100644 index 0000000..6dc54a5 --- /dev/null +++ b/products/migrations/0001_initial.py @@ -0,0 +1,31 @@ +# Generated by Django 4.2.5 on 2023-09-28 22:09 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('product_title', models.CharField(max_length=255, verbose_name='Наименование товара')), + ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Цена товара')), + ('is_active_sale', models.BooleanField(choices=[(True, 'В продаже'), (False, 'Снят с продажи')], default=True, verbose_name='Статус товара')), + ('seller', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='seller', to=settings.AUTH_USER_MODEL, verbose_name='Продавец')), + ], + options={ + 'verbose_name': 'Товар', + 'verbose_name_plural': 'Товары', + }, + ), + ]