Changes between Initial Version and Version 1 of Ticket #26770


Ignore:
Timestamp:
Jun 16, 2016, 10:44:54 PM (9 years ago)
Author:
Louis Lang
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26770

    • Property Summary Migrations on app named 'settings' failsMigrations on app named 'settings' fails when callable default on a field present
  • Ticket #26770 – Description

    initial v1  
    1010import django.db.models.deletion
    1111import settings.models
     12 
     13 
     14class Migration(migrations.Migration):
     15 
     16    initial = True
     17 
     18    dependencies = [
     19        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
     20    ]
     21 
     22    operations = [
     23        migrations.CreateModel(
     24            name='Setting',
     25            fields=[
     26                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
     27                ('name', models.CharField(blank=True, max_length=250, null=True)),
     28                ('email', models.EmailField(blank=True, max_length=254, null=True)),
     29                ('phone', models.CharField(blank=True, max_length=20, null=True)),
     30                ('url', models.URLField(blank=True, null=True)),
     31                ('paypal_email', models.EmailField(blank=True, max_length=254, null=True)),
     32            ],
     33        ),
     34        migrations.CreateModel(
     35            name='Theme',
     36            fields=[
     37                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
     38                ('name', models.CharField(max_length=250, unique=True)),
     39                ('preview_image', models.ImageField(upload_to=settings.models.get_preview_path)),
     40                ('description', models.CharField(max_length=1000)),
     41                ('premium_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
     42            ],
     43        ),
     44        migrations.CreateModel(
     45            name='ThemeAttribute',
     46            fields=[
     47                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
     48                ('name', models.CharField(max_length=250)),
     49                ('type', models.CharField(choices=[(b'1', b'TextArea'), (b'2', b'Image'), (b'3', b'TextField')], max_length=1)),
     50                ('width', models.IntegerField(blank=True, null=True)),
     51                ('height', models.IntegerField(blank=True, null=True)),
     52                ('description', models.CharField(max_length=2500)),
     53                ('theme', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attributes', to='settings.Theme')),
     54            ],
     55        ),
     56        migrations.CreateModel(
     57            name='ThemeImageAttribute',
     58            fields=[
     59                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
     60                ('image', models.ImageField(blank=True, null=True, upload_to=settings.models.get_attribute_path)),
     61                ('attribute', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='image_attributes', to='settings.ThemeAttribute')),
     62                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
     63            ],
     64        ),
     65        migrations.CreateModel(
     66            name='ThemeTextAttribute',
     67            fields=[
     68                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
     69                ('text', models.CharField(blank=True, max_length=5000, null=True)),
     70                ('attribute', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='text_attributes', to='settings.ThemeAttribute')),
     71                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
     72            ],
     73        ),
     74        migrations.CreateModel(
     75            name='ThemeTextFieldAttribute',
     76            fields=[
     77                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
     78                ('text', models.CharField(blank=True, max_length=500, null=True)),
     79                ('attribute', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='textfield_attributes', to='settings.ThemeAttribute')),
     80                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
     81            ],
     82        ),
     83        migrations.AddField(
     84            model_name='setting',
     85            name='theme',
     86            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='settings.Theme'),
     87        ),
     88        migrations.AddField(
     89            model_name='setting',
     90            name='user',
     91            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
     92        ),
     93        migrations.AlterUniqueTogether(
     94            name='themeattribute',
     95            unique_together=set([('theme', 'name')]),
     96        ),
     97    ]
    1298}}}
    1399
Back to Top