1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- # Generated by Django 4.1.4 on 2023-01-06 14:21
- from django.conf import settings
- from django.db import migrations, models
- import django.db.models.deletion
- import main.utilities
- class Migration(migrations.Migration):
- dependencies = [
- ('main', '0002_rubric_alter_advuser_send_messages_subrubric_and_more'),
- ]
- operations = [
- migrations.CreateModel(
- name='Ad',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('title', models.CharField(max_length=40, verbose_name='Товар')),
- ('content', models.TextField(verbose_name='Описание')),
- ('price', models.FloatField(default=0, verbose_name='Цена')),
- ('contacts', models.TextField(verbose_name='Контакты')),
- ('image', models.ImageField(blank=True, upload_to=main.utilities.get_timestamp_path, verbose_name='Изображение')),
- ('is_active', models.BooleanField(db_index=True, default=True, verbose_name='Выводить в списке объявлений?')),
- ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Опубликовано')),
- ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Автор объявления')),
- ('rubric', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='main.subrubric', verbose_name='Рубрика')),
- ],
- options={
- 'verbose_name': 'Объявление',
- 'verbose_name_plural': 'Объявления',
- 'ordering': ['-created_at'],
- },
- ),
- migrations.AlterField(
- model_name='rubric',
- name='name',
- field=models.CharField(db_index=True, max_length=30, unique=True, verbose_name='Название'),
- ),
- migrations.CreateModel(
- name='AdditionalImage',
- fields=[
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
- ('image', models.ImageField(upload_to=main.utilities.get_timestamp_path, verbose_name='Изображение')),
- ('ad', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.ad', verbose_name='Объявление')),
- ],
- options={
- 'verbose_name': 'Дополнительное изображение',
- 'verbose_name_plural': 'Дополнительные изображения',
- },
- ),
- ]
|