Beispiel #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('catalog', '0004_delete_product'),
    ]

    operations = [
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=120)),
                ('slug', models.SlugField()),
                ('description', models.TextField()),
                ('image',
                 models.ImageField(
                     upload_to=catalog.models.Product.image_folder)),
                ('price', models.DecimalField(decimal_places=2, max_digits=9)),
                ('available', models.BooleanField(default=True)),
                ('brand',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='catalog.Brand')),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.PROTECT,
                                   to='catalog.Category')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('catalog', '0005_auto_20190111_1739'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='bookorderinstance',
            options={'verbose_name_plural': 'Book Orders'},
        ),
        migrations.AlterField(
            model_name='book',
            name='image',
            field=models.ImageField(blank=True,
                                    default='book_images/book.png',
                                    upload_to='book_images/'),
        ),
        migrations.AlterField(
            model_name='book',
            name='is_available',
            field=models.BooleanField(
                default=True,
                editable=False,
                help_text='Availability status of a book'),
        ),
        migrations.AlterField(
            model_name='bookorderinstance',
            name='book',
            field=models.ForeignKey(
                help_text='Enter book to be lent out',
                limit_choices_to={'is_available': True},
                on_delete=django.db.models.deletion.CASCADE,
                to='catalog.Book'),
        ),
        migrations.AlterField(
            model_name='bookorderinstance',
            name='due_date',
            field=models.DateField(
                blank=True,
                default=catalog.models.BookOrderInstance.default_due_date,
                editable=False),
        ),
        migrations.AlterField(
            model_name='bookorderinstance',
            name='return_date',
            field=models.DateField(blank=True, editable=False, null=True),
        ),
    ]
Beispiel #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='ShopItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     default='0',
                                     max_digits=9,
                                     verbose_name='Цена')),
                ('first_image',
                 models.ImageField(null='media/no_image.png',
                                   upload_to=catalog.models.imagePath,
                                   verbose_name='Первое фото')),
                ('second_image',
                 models.ImageField(null='media/no_image.png',
                                   upload_to=catalog.models.imagePath,
                                   verbose_name='Второе фото')),
                ('title',
                 models.CharField(default='',
                                  max_length=120,
                                  verbose_name='Заголовок')),
                ('manufacter',
                 models.CharField(default='',
                                  max_length=50,
                                  verbose_name='Изготовитель')),
                ('slug',
                 models.SlugField(blank=True, editable=False, unique=True)),
                ('rating',
                 models.IntegerField(choices=[(1, '1'), (2, '2'), (3, '3'),
                                              (4, '4'), (5, '5')],
                                     default=1,
                                     verbose_name='Рейтинг')),
                ('category', models.CharField(editable=False, max_length=20)),
                ('clicks', models.IntegerField(default=0, editable=False)),
            ],
        ),
        migrations.CreateModel(
            name='Accessorie',
            fields=[
                ('shopitem_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.ShopItem')),
                ('type', models.CharField(max_length=50, verbose_name='Тип')),
                ('color', models.CharField(max_length=50,
                                           verbose_name='Цвет')),
            ],
            bases=('catalog.shopitem', ),
        ),
        migrations.CreateModel(
            name='Device',
            fields=[
                ('shopitem_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.ShopItem')),
                ('os',
                 models.CharField(default='Android',
                                  max_length=50,
                                  verbose_name='Система')),
                ('year', models.IntegerField(default=2010,
                                             verbose_name='Год')),
                ('camera', models.IntegerField(default=8,
                                               verbose_name='Камера')),
                ('display',
                 models.CharField(default='1920x1080',
                                  max_length=50,
                                  verbose_name='Разрешение')),
                ('battery',
                 models.IntegerField(default=1000, verbose_name='Батарея')),
                ('capacity',
                 models.IntegerField(default=1800,
                                     verbose_name='Вместимость')),
                ('chip',
                 models.CharField(default='MTK',
                                  max_length=50,
                                  verbose_name='Процессор')),
                ('color',
                 models.CharField(default='черный',
                                  max_length=50,
                                  verbose_name='Цвет')),
                ('has_wifi',
                 models.BooleanField(default=True,
                                     verbose_name='Есть Wi-fi?')),
                ('weight', models.IntegerField(default=400,
                                               verbose_name='Вес')),
            ],
            bases=('catalog.shopitem', ),
        ),
        migrations.CreateModel(
            name='Cable',
            fields=[
                ('accessorie_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Accessorie')),
                ('features',
                 models.CharField(max_length=50, verbose_name='Вход')),
                ('compatibility',
                 models.CharField(max_length=50, verbose_name='Выход')),
            ],
            options={
                'verbose_name_plural': 'Кабеля',
            },
            bases=('catalog.accessorie', ),
        ),
        migrations.CreateModel(
            name='Cover',
            fields=[
                ('accessorie_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Accessorie')),
                ('material',
                 models.CharField(max_length=50, verbose_name='Материал')),
                ('design',
                 models.CharField(max_length=50, verbose_name='Дизайн')),
            ],
            options={
                'verbose_name_plural': 'Чехлы',
            },
            bases=('catalog.accessorie', ),
        ),
        migrations.CreateModel(
            name='Headphone',
            fields=[
                ('accessorie_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Accessorie')),
                ('communication',
                 models.CharField(max_length=50, verbose_name='Соединение')),
                ('frequency',
                 models.CharField(max_length=50,
                                  verbose_name='Максимальная частота')),
                ('connectors',
                 models.CharField(max_length=50, verbose_name='Разьем')),
            ],
            options={
                'verbose_name_plural': 'Наушники',
            },
            bases=('catalog.accessorie', ),
        ),
        migrations.CreateModel(
            name='Phone',
            fields=[
                ('device_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Device')),
                ('access',
                 models.CharField(max_length=50, verbose_name='Доступ')),
                ('sim_format',
                 models.CharField(max_length=50,
                                  verbose_name='Поддерживаемый формат SIM')),
            ],
            options={
                'verbose_name_plural': 'Телефоны',
            },
            bases=('catalog.device', ),
        ),
        migrations.CreateModel(
            name='Sdcard',
            fields=[
                ('accessorie_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Accessorie')),
                ('capacity', models.IntegerField(verbose_name='Вместимость')),
                ('speed', models.IntegerField(verbose_name='Скорость записи')),
            ],
            options={
                'verbose_name_plural': 'SD-карты',
            },
            bases=('catalog.accessorie', ),
        ),
        migrations.CreateModel(
            name='Tablet',
            fields=[
                ('device_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='catalog.Device')),
                ('has_pen', models.BooleanField(verbose_name='Есть стилус?')),
                ('has_keyboard',
                 models.BooleanField(verbose_name='Есть клавиатура?')),
            ],
            options={
                'verbose_name_plural': 'Планшеты',
            },
            bases=('catalog.device', ),
        ),
    ]
Beispiel #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('surname', models.CharField(max_length=200)),
                ('name', models.CharField(max_length=200)),
                ('patronymic', models.CharField(max_length=200)),
                ('birth_date', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('uuid',
                 models.UUIDField(
                     default=uuid.uuid4,
                     help_text=
                     'Unique ID for this particular book across whole library')
                 ),
                ('title', models.CharField(max_length=200)),
                ('pub_date',
                 models.DateTimeField(default=datetime.datetime(2018,
                                                                5,
                                                                21,
                                                                2,
                                                                45,
                                                                0,
                                                                85829,
                                                                tzinfo=utc),
                                      verbose_name='date published')),
                ('read_date',
                 models.DateTimeField(verbose_name='date reading')),
                ('image', models.ImageField(blank=True,
                                            null=True,
                                            upload_to='')),
                ('file',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to='',
                                  validators=[catalog.models.file_size])),
                ('can_download', models.BooleanField(default=False)),
                ('author',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Author')),
            ],
        ),
        migrations.CreateModel(
            name='BookReading',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date_last_read',
                 models.DateTimeField(verbose_name='time last reading')),
                ('book',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Book')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='bookreading',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='catalog.Profile'),
        ),
    ]
Beispiel #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('finance', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Дата обновления')),
                ('title', models.CharField(max_length=250)),
                ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(db_index=True, editable=False)),
                ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='catalog.Category')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('_tree_manager', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Дата обновления')),
                ('title', models.CharField(max_length=250)),
                ('text', models.TextField()),
                ('course', models.DecimalField(decimal_places=5, max_digits=10)),
                ('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='finance.Currency')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Дата обновления')),
                ('image', models.ImageField(upload_to=catalog.models.set_product_image_name)),
                ('alt', models.CharField(blank=True, max_length=150, null=True)),
                ('is_main', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ProductVariant',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Дата обновления')),
                ('price', models.DecimalField(decimal_places=2, max_digits=12)),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='catalog.Product')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='productimage',
            name='product_variant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='catalog.ProductVariant'),
        ),
    ]
Beispiel #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(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')),
                ('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')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('bool_is_author', models.BooleanField(default=False, help_text='Designates whether user is an author', verbose_name='Author')),
                ('bool_is_editor', models.BooleanField(default=False, help_text='Designates whether user is an editor', verbose_name='Editor')),
                ('bool_is_executive_editor', models.BooleanField(default=False, help_text='Designates whether user is an executive editor', verbose_name='Executive editor')),
                ('first_name', models.CharField(max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(max_length=30, verbose_name='last name')),
                ('bio', models.TextField(blank=True)),
                ('profile_pic', models.ImageField(blank=True, default='default_profile_pic.jpg', upload_to='')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', catalog.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('text', models.TextField(default='Start typing here...')),
                ('thumb', models.ImageField(blank=True, default='default.png', upload_to='')),
                ('pub_date', models.DateTimeField(auto_now_add=True)),
                ('layout', models.CharField(choices=[('LO1', 'Normal'), ('LO2', 'Two columns'), ('LO3', 'Picture in middle')], default='LO1', max_length=3)),
                ('is_published', models.BooleanField(default=False, help_text='Publish article')),
                ('is_reviewed', models.BooleanField(default=False, help_text='Review article')),
                ('last_edited', models.DateTimeField(auto_now=True)),
                ('assigned_proof_read', models.ManyToManyField(blank=True, limit_choices_to={'bool_is_editor': True}, related_name='proof_read', to=settings.AUTH_USER_MODEL)),
                ('author', models.ManyToManyField(blank=True, limit_choices_to={'bool_is_author': True}, related_name='author', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-pub_date'],
            },
        ),
        migrations.CreateModel(
            name='ColorScheme',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('color', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=254)),
                ('body', models.TextField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('active', models.BooleanField(default=True)),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='catalog.Article')),
            ],
            options={
                'ordering': ('created',),
            },
        ),
        migrations.CreateModel(
            name='Layout',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('layout', models.CharField(choices=[('layout_one_column.html', 'One column'), ('layout_articles_side_by_side.html', 'Two columns'), ('layout_big_article.html', 'Big two columns')], default='layout_one_column.html', max_length=33)),
            ],
        ),
        migrations.CreateModel(
            name='RateComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=254)),
                ('body', models.TextField()),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('active', models.BooleanField(default=True)),
                ('rating', models.IntegerField(default=1, validators=[django.core.validators.MaxValueValidator(10), django.core.validators.MinValueValidator(1)], verbose_name='Rating 1-10')),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ratecomments', to='catalog.Article')),
            ],
            options={
                'ordering': ('created',),
            },
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('body', models.TextField()),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True)),
            ],
        ),
        migrations.AddField(
            model_name='article',
            name='tag',
            field=models.ManyToManyField(blank=True, related_name='article_tag', to='catalog.Tag'),
        ),
        migrations.AddField(
            model_name='user',
            name='favorites',
            field=models.ManyToManyField(blank=True, related_name='favorites', to='catalog.Article'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=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'),
        ),
        migrations.AddField(
            model_name='user',
            name='subscribe_author',
            field=models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='subscribe_tag',
            field=models.ManyToManyField(blank=True, related_name='subscribe_tag', to='catalog.Tag'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=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'),
        ),
    ]
Beispiel #7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='CustomUser',
            fields=[
                ('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')),
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('email',
                 models.EmailField(max_length=255,
                                   unique=True,
                                   verbose_name='Email')),
                ('is_staff',
                 models.BooleanField(default=False, verbose_name='Is staff')),
                ('is_active',
                 models.BooleanField(default=True, verbose_name='Is active')),
                ('joined_at',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='Joined at')),
            ],
            options={
                'verbose_name': 'User',
                'verbose_name_plural': 'Users',
            },
        ),
        migrations.CreateModel(
            name='Brewing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('temperature',
                 models.PositiveSmallIntegerField(
                     blank=True,
                     default=0,
                     null=True,
                     validators=[
                         django.core.validators.MaxValueValidator(100)
                     ])),
                ('weight',
                 models.FloatField(
                     blank=True,
                     default=0,
                     null=True,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('initial',
                 models.DurationField(blank=True,
                                      default=datetime.timedelta(0),
                                      null=True)),
                ('increments',
                 models.DurationField(blank=True,
                                      default=datetime.timedelta(0),
                                      null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(choices=[('WHITE', 'WHITE'),
                                           ('YELLOW', 'YELLOW'),
                                           ('GREEN', 'GREEN'),
                                           ('OOLONG', 'OOLONG'),
                                           ('BLACK', 'BLACK'),
                                           ('FERMENTED', 'FERMENTED'),
                                           ('HERBAL', 'HERBAL'),
                                           ('SCENTED', 'SCENTED'),
                                           ('OTHER', 'OTHER')],
                                  max_length=20)),
                ('description', models.TextField(blank=True)),
                ('description_source',
                 models.CharField(blank=True, max_length=100)),
                ('gongfu_brewing',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='catalog.Brewing')),
                ('western_brewing',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='catalog.Brewing')),
            ],
        ),
        migrations.CreateModel(
            name='Origin',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('is_public', models.BooleanField(default=False)),
                ('country', models.CharField(max_length=30)),
                ('region', models.CharField(blank=True, max_length=50)),
                ('locality', models.CharField(blank=True, max_length=50)),
                ('latitude', models.FloatField(blank=True, null=True)),
                ('longitude', models.FloatField(blank=True, null=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['country', 'region', 'locality'],
            },
        ),
        migrations.CreateModel(
            name='Subcategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('is_public', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50)),
                ('translated_name', models.CharField(blank=True,
                                                     max_length=50)),
                ('description', models.TextField(blank=True)),
                ('description_source',
                 models.CharField(blank=True, max_length=100)),
                ('category',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Category')),
                ('gongfu_brewing',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='catalog.Brewing')),
                ('origin',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.Origin')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('western_brewing',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='catalog.Brewing')),
            ],
        ),
        migrations.CreateModel(
            name='Vendor',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('is_public', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50)),
                ('website', models.CharField(blank=True, max_length=50)),
                ('popularity',
                 models.PositiveSmallIntegerField(
                     blank=True,
                     default=5,
                     null=True,
                     validators=[django.core.validators.MaxValueValidator(10)
                                 ])),
                ('origin',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.Origin')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='VendorTrademark',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('vendor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Vendor')),
            ],
        ),
        migrations.CreateModel(
            name='Tea',
            fields=[
                ('id',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  primary_key=True,
                                  serialize=False)),
                ('is_archived', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=50)),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=catalog.models.get_upload_path)),
                ('year',
                 models.SmallIntegerField(
                     blank=True,
                     null=True,
                     validators=[
                         django.core.validators.MinValueValidator(1900),
                         django.core.validators.MaxValueValidator(2100)
                     ])),
                ('gongfu_preferred', models.BooleanField(default=True)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('last_consumed_on', models.DateTimeField(auto_now=True)),
                ('price',
                 models.FloatField(
                     blank=True,
                     default=0,
                     null=True,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('weight_left',
                 models.FloatField(
                     blank=True,
                     default=0,
                     null=True,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('weight_consumed',
                 models.FloatField(
                     blank=True,
                     default=0,
                     null=True,
                     validators=[django.core.validators.MinValueValidator(0)
                                 ])),
                ('rating',
                 models.SmallIntegerField(
                     blank=True,
                     default=0,
                     null=True,
                     validators=[
                         django.core.validators.MinValueValidator(0),
                         django.core.validators.MaxValueValidator(10)
                     ])),
                ('notes',
                 models.TextField(blank=True, max_length=10000, null=True)),
                ('category',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Category')),
                ('gongfu_brewing',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='catalog.Brewing')),
                ('origin',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.Origin')),
                ('subcategory',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.Subcategory')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('vendor',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.Vendor')),
                ('western_brewing',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to='catalog.Brewing')),
            ],
        ),
        migrations.CreateModel(
            name='SubcategoryName',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('subcategory',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Subcategory')),
            ],
        ),
        migrations.CreateModel(
            name='CategoryName',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Category')),
            ],
        ),
        migrations.AddConstraint(
            model_name='brewing',
            constraint=models.UniqueConstraint(fields=('temperature', 'weight',
                                                       'initial',
                                                       'increments'),
                                               name='unique_brewing'),
        ),
        migrations.AddField(
            model_name='customuser',
            name='groups',
            field=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'),
        ),
        migrations.AddField(
            model_name='customuser',
            name='user_permissions',
            field=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'),
        ),
        migrations.AddConstraint(
            model_name='origin',
            constraint=models.UniqueConstraint(fields=('user', 'country',
                                                       'region', 'locality'),
                                               name='unique_origin'),
        ),
        migrations.AddConstraint(
            model_name='origin',
            constraint=models.UniqueConstraint(
                condition=models.Q(locality=None),
                fields=('user', 'country', 'region'),
                name='unique_region_origin'),
        ),
        migrations.AddConstraint(
            model_name='origin',
            constraint=models.UniqueConstraint(condition=models.Q(region=None),
                                               fields=('user', 'country',
                                                       'locality'),
                                               name='unique_locality_origin'),
        ),
    ]
Beispiel #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='Collection',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name': 'Collection',
                'verbose_name_plural': 'Collections',
            },
        ),
        migrations.CreateModel(
            name='FileType',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name': 'File Type',
                'verbose_name_plural': 'File Types',
            },
        ),
        migrations.CreateModel(
            name='Keyword',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name': 'Keyword',
                'verbose_name_plural': 'Keywords',
            },
        ),
        migrations.CreateModel(
            name='CatalogItem',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('accession_number',
                 models.CharField(blank=True,
                                  max_length=25,
                                  null=True,
                                  verbose_name='Accession Number')),
                ('accession_date',
                 models.DateField(auto_now_add=True,
                                  null=True,
                                  verbose_name='Accession Date')),
                ('obj_name',
                 models.CharField(blank=True,
                                  max_length=250,
                                  null=True,
                                  verbose_name='Object Date')),
                ('obj_file',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=catalog.models.catalog_files,
                                  verbose_name='Object')),
                ('description', models.TextField(blank=True, null=True)),
                ('source',
                 models.CharField(blank=True, max_length=250, null=True)),
                ('approx_obj_date',
                 models.DateField(blank=True,
                                  null=True,
                                  verbose_name='Approximate Object Date')),
                ('start_year',
                 models.PositiveIntegerField(blank=True,
                                             null=True,
                                             verbose_name='Start Year Range')),
                ('end_year',
                 models.PositiveIntegerField(blank=True,
                                             null=True,
                                             verbose_name='End Year Range')),
                ('provenance', models.TextField(blank=True, null=True)),
                ('notes', models.TextField(blank=True, null=True)),
                ('accession_img',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=catalog.models.catalog_files,
                                   verbose_name='Accession Image')),
                ('accession_img_caption',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Accession Image Caption')),
                ('accession_img_description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Accession Image Description')),
                ('downloadable', models.BooleanField(default=False)),
                ('added_by',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='Added By')),
                ('category',
                 models.ManyToManyField(related_name='categories',
                                        to='catalog.Category')),
                ('collection',
                 models.ManyToManyField(related_name='collections',
                                        to='catalog.Collection')),
                ('file_format',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.filetype',
                     verbose_name='File Type')),
                ('keyword',
                 models.ManyToManyField(blank=True,
                                        null=True,
                                        related_name='keywords',
                                        to='catalog.Keyword')),
            ],
            options={
                'verbose_name': 'Catalog Item',
                'verbose_name_plural': 'Catalog Items',
            },
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=200,
                                  verbose_name='Наименование')),
                ('url', models.CharField(max_length=200,
                                         verbose_name='Ссылка')),
                ('description', models.TextField(verbose_name='Описание')),
                ('published',
                 models.BooleanField(default=1, verbose_name='Опубликовано')),
                ('created_date',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      editable=False,
                                      verbose_name='Дата добавления')),
            ],
            options={
                'verbose_name': 'Категорию',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.CreateModel(
            name='Detail',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=200,
                                  verbose_name='Наименование')),
                ('description', models.TextField(verbose_name='Описание')),
                ('image',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to=catalog.models.UploadImageForDetail,
                     verbose_name='Изображение')),
                ('url',
                 models.CharField(blank=True,
                                  max_length=200,
                                  null=True,
                                  verbose_name='Ссылка')),
                ('published',
                 models.BooleanField(default=1, verbose_name='Опубликовано')),
                ('created_date',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      editable=False,
                                      verbose_name='Дата добавления')),
            ],
            options={
                'verbose_name': 'Запчасть',
                'verbose_name_plural': 'Запчасти',
            },
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(max_length=200,
                                  verbose_name='Наименование')),
                ('description', models.TextField(verbose_name='Описание')),
                ('image',
                 models.FileField(blank=True,
                                  null=True,
                                  upload_to=catalog.models.UploadImageForItem,
                                  verbose_name='Изображение')),
                ('url',
                 models.CharField(blank=True,
                                  max_length=200,
                                  null=True,
                                  verbose_name='Ссылка')),
                ('published',
                 models.BooleanField(default=1, verbose_name='Опубликовано')),
                ('created_date',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      editable=False,
                                      verbose_name='Дата добавления')),
                ('category',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='catalog.Category',
                     verbose_name='Категория')),
            ],
            options={
                'verbose_name': 'Продукт',
                'verbose_name_plural': 'Продукты',
            },
        ),
        migrations.AddField(
            model_name='detail',
            name='items',
            field=models.ManyToManyField(to='catalog.Item',
                                         verbose_name='Изделия'),
        ),
    ]
Beispiel #10
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('pages', '0015_add_validation_to_template'),
    ]

    operations = [
        migrations.CreateModel(
            name='AnotherRelatedEntity',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('is_active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='MockCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=255,
                                  verbose_name='name')),
                ('lft',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('page',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='tests_mockcategory',
                     to='pages.Page')),
                ('parent',
                 mptt.fields.TreeForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='children',
                     to='tests.MockCategory',
                     verbose_name='parent')),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
                'abstract': False,
            },
            bases=(models.Model, catalog.models.AdminTreeDisplayMixin),
        ),
        migrations.CreateModel(
            name='MockCategoryWithDefaultPage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=255,
                                  verbose_name='name')),
                ('lft',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('page',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='tests_mockcategorywithdefaultpage',
                     to='pages.Page')),
                ('parent',
                 mptt.fields.TreeForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='children',
                     to='tests.MockCategoryWithDefaultPage',
                     verbose_name='parent')),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
                'abstract': False,
            },
            bases=(models.Model, catalog.models.AdminTreeDisplayMixin),
        ),
        migrations.CreateModel(
            name='MockEcommerceCategory',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=255,
                                  verbose_name='name')),
                ('lft',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('level',
                 models.PositiveIntegerField(db_index=True, editable=False)),
                ('page',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='tests_mockecommercecategory',
                     to='pages.Page')),
                ('parent',
                 mptt.fields.TreeForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='children',
                     to='tests.MockEcommerceCategory',
                     verbose_name='parent')),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
                'abstract': False,
            },
            bases=(models.Model, catalog.models.AdminTreeDisplayMixin),
        ),
        migrations.CreateModel(
            name='MockEcommerceProduct',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=255,
                                  verbose_name='name')),
                ('price',
                 models.FloatField(blank=True,
                                   db_index=True,
                                   default=0,
                                   verbose_name='price')),
                ('in_stock',
                 models.PositiveIntegerField(db_index=True,
                                             default=0,
                                             verbose_name='in stock')),
                ('is_popular',
                 models.BooleanField(db_index=True,
                                     default=False,
                                     verbose_name='is popular')),
                ('category',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='products',
                                   to='tests.MockEcommerceCategory')),
                ('page',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='tests_mockecommerceproduct',
                     to='pages.Page')),
            ],
            options={
                'verbose_name': 'Product',
                'verbose_name_plural': 'Products',
                'ordering': ['name'],
                'abstract': False,
            },
            bases=(models.Model, catalog.models.AdminTreeDisplayMixin),
        ),
        migrations.CreateModel(
            name='MockEntity',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('is_active', models.BooleanField(default=True)),
                ('slug', models.SlugField(default='/so-mock-wow/')),
                ('page',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='tests_mockentity',
                     to='pages.Page')),
                ('parent',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='tests.MockEntity')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MockEntityWithRelations',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('is_active', models.BooleanField(default=True)),
                ('another_related_entity',
                 models.ForeignKey(blank=True,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='tests.AnotherRelatedEntity')),
            ],
        ),
        migrations.CreateModel(
            name='MockEntityWithSync',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('page',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='tests_mockentitywithsync',
                     to='pages.Page')),
                ('parent',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     to='tests.MockEntityWithSync')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MockProduct',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name',
                 models.CharField(db_index=True,
                                  max_length=255,
                                  verbose_name='name')),
                ('price',
                 models.FloatField(blank=True,
                                   db_index=True,
                                   default=0,
                                   verbose_name='price')),
                ('in_stock',
                 models.PositiveIntegerField(db_index=True,
                                             default=0,
                                             verbose_name='in stock')),
                ('is_popular',
                 models.BooleanField(db_index=True,
                                     default=False,
                                     verbose_name='is popular')),
                ('category',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='products',
                                   to='tests.MockCategory')),
                ('page',
                 models.OneToOneField(
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     related_name='tests_mockproduct',
                     to='pages.Page')),
            ],
            options={
                'verbose_name': 'Product',
                'verbose_name_plural': 'Products',
                'ordering': ['name'],
                'abstract': False,
            },
            bases=(models.Model, catalog.models.AdminTreeDisplayMixin),
        ),
        migrations.CreateModel(
            name='RelatedEntity',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('is_active', models.BooleanField(default=True)),
            ],
        ),
        migrations.AddField(
            model_name='mockentitywithrelations',
            name='related_entity',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='tests.RelatedEntity'),
        ),
        migrations.AlterUniqueTogether(
            name='mockecommercecategory',
            unique_together=set([('name', 'parent')]),
        ),
        migrations.AlterUniqueTogether(
            name='mockcategorywithdefaultpage',
            unique_together=set([('name', 'parent')]),
        ),
        migrations.AlterUniqueTogether(
            name='mockcategory',
            unique_together=set([('name', 'parent')]),
        ),
    ]
Beispiel #11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(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(max_length=100, unique=True)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('idnum', models.IntegerField(null=True, unique=True)),
                ('firstname', models.CharField(max_length=100)),
                ('lastname', models.CharField(max_length=100)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('is_manager', models.BooleanField(null=True)),
                ('is_administrator', models.BooleanField(null=True)),
                ('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',
            },
            managers=[
                ('objects', catalog.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('author', models.TextField(max_length=200)),
                ('publisher', models.CharField(max_length=200)),
                ('publication_year', models.IntegerField()),
                ('isbn',
                 models.CharField(
                     help_text=
                     '13 Character <a href="https://www.isbn-international.org/content/what-isbn">ISBN number</a>',
                     max_length=13,
                     verbose_name='ISBN')),
                ('reserved', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField()),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(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')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  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')),
                ('email',
                 models.EmailField(max_length=254,
                                   unique=True,
                                   verbose_name='email address')),
                ('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', catalog.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='service_project',
            fields=[
                ('project_ID',
                 models.IntegerField(primary_key=True, serialize=False)),
                ('project_title',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('project_duration',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('project_location',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('project_leader',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('project_date',
                 models.CharField(help_text='Enter field documentation',
                                  max_length=15)),
                ('members_needed', models.IntegerField(default=4)),
                ('wait_list', models.IntegerField(default=2)),
            ],
            options={
                'db_table': 'catalog_service_project',
            },
        ),
        migrations.CreateModel(
            name='work_order',
            fields=[
                ('work_order_id',
                 models.IntegerField(primary_key=True, serialize=False)),
            ],
        ),
    ]
Beispiel #13
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Area',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Nombre')),
                ('slug', models.SlugField()),
                ('description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Descripción')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=catalog.models.get_upload_path,
                                   verbose_name='Imagen')),
                ('active',
                 models.BooleanField(default=True, verbose_name='Activo')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Nombre')),
                ('slug', models.SlugField()),
                ('description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Descripción')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=catalog.models.get_upload_path,
                                   verbose_name='Imagen')),
                ('active',
                 models.BooleanField(default=True, verbose_name='Activo')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('area',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='catalog.Area')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Service',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200,
                                          verbose_name='Nombre')),
                ('slug', models.SlugField()),
                ('description',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='Descripción')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=catalog.models.get_upload_path,
                                   verbose_name='Imagen')),
                ('active',
                 models.BooleanField(default=True, verbose_name='Activo')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='area',
            name='service',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='catalog.Service'),
        ),
    ]