Changeset View
Changeset View
Standalone View
Standalone View
films/migrations/0001_initial.py
| Show All 19 Lines | def collection_overview_upload_path(collection: 'Collection', filename: str) -> str: | ||||
| ) | ) | ||||
| class Migration(migrations.Migration): | class Migration(migrations.Migration): | ||||
| initial = True | initial = True | ||||
| dependencies = [ | dependencies = [ | ||||
| ('assets', '0001_initial'), | ('static_assets', '0001_initial'), | ||||
| ] | ] | ||||
| operations = [ | operations = [ | ||||
| migrations.CreateModel( | migrations.CreateModel( | ||||
| name='Film', | name='Film', | ||||
| fields=[ | fields=[ | ||||
| ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||||
| ('date_created', models.DateTimeField(auto_now_add=True)), | ('date_created', models.DateTimeField(auto_now_add=True)), | ||||
| Show All 37 Lines | operations = [ | ||||
| ('order', models.IntegerField()), | ('order', models.IntegerField()), | ||||
| ('name', models.CharField(max_length=512)), | ('name', models.CharField(max_length=512)), | ||||
| ('slug', models.SlugField(blank=True)), | ('slug', models.SlugField(blank=True)), | ||||
| ('description', models.TextField()), | ('description', models.TextField()), | ||||
| ('category', models.CharField(choices=[('artwork', 'Artwork'), ('production_file', 'Production File'), ('production_lesson', 'Production Lesson')], db_index=True, max_length=17)), | ('category', models.CharField(choices=[('artwork', 'Artwork'), ('production_file', 'Production File'), ('production_lesson', 'Production Lesson')], db_index=True, max_length=17)), | ||||
| ('view_count', models.PositiveIntegerField(default=0)), | ('view_count', models.PositiveIntegerField(default=0)), | ||||
| ('visibility', models.BooleanField(default=False)), | ('visibility', models.BooleanField(default=False)), | ||||
| ('collection', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assets', to='films.Collection')), | ('collection', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assets', to='films.Collection')), | ||||
| ('static_asset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assets', to='assets.StaticAsset')), | ('static_asset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assets', to='static_assets.StaticAsset')), | ||||
| ], | ], | ||||
| ), | ), | ||||
| migrations.AddConstraint( | migrations.AddConstraint( | ||||
| model_name='collection', | model_name='collection', | ||||
| constraint=models.UniqueConstraint(fields=('parent', 'order'), name='unique_ordering_per_collection'), | constraint=models.UniqueConstraint(fields=('parent', 'order'), name='unique_ordering_per_collection'), | ||||
| ), | ), | ||||
| migrations.AddConstraint( | migrations.AddConstraint( | ||||
| model_name='collection', | model_name='collection', | ||||
| constraint=models.UniqueConstraint(fields=('parent', 'slug'), name='unique_slug_per_collection'), | constraint=models.UniqueConstraint(fields=('parent', 'slug'), name='unique_slug_per_collection'), | ||||
| ), | ), | ||||
| ] | ] | ||||