summaryrefslogtreecommitdiff
path: root/ishtar_common/migrations/0021_auto_20171110_1717.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-11-10 17:20:01 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-11-10 17:20:01 +0100
commit2e4847a414f44600dc25fd1152c1bcff173f76de (patch)
tree5af06729ecc00c740f127d5fd57d1c383efb4e90 /ishtar_common/migrations/0021_auto_20171110_1717.py
parent6f32d8713096f85029c213954816ea50d06f9643 (diff)
downloadIshtar-2e4847a414f44600dc25fd1152c1bcff173f76de.tar.bz2
Ishtar-2e4847a414f44600dc25fd1152c1bcff173f76de.zip
Models: generic images with m2m relations with main items
Diffstat (limited to 'ishtar_common/migrations/0021_auto_20171110_1717.py')
-rw-r--r--ishtar_common/migrations/0021_auto_20171110_1717.py77
1 files changed, 77 insertions, 0 deletions
diff --git a/ishtar_common/migrations/0021_auto_20171110_1717.py b/ishtar_common/migrations/0021_auto_20171110_1717.py
new file mode 100644
index 000000000..c95f5e1d8
--- /dev/null
+++ b/ishtar_common/migrations/0021_auto_20171110_1717.py
@@ -0,0 +1,77 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11 on 2017-11-10 17:17
+from __future__ import unicode_literals
+
+import django.core.validators
+from django.db import migrations, models
+import django.db.models.deletion
+import ishtar_common.models
+import re
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0020_auto_20171030_1708'),
+ ]
+
+ operations = [
+ migrations.CreateModel(
+ name='ImageType',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('label', models.CharField(max_length=100, verbose_name='Label')),
+ ('txt_idx', models.CharField(help_text='The slug is the standardized version of the name. It contains only lowercase letters, numbers and hyphens. Each slug must be unique.', max_length=100, unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')], verbose_name='Textual ID')),
+ ('comment', models.TextField(blank=True, null=True, verbose_name='Comment')),
+ ('available', models.BooleanField(default=True, verbose_name='Available')),
+ ],
+ options={
+ 'ordering': ('label',),
+ 'verbose_name': 'Image type',
+ 'verbose_name_plural': 'Image types',
+ },
+ bases=(ishtar_common.models.Cached, models.Model),
+ ),
+ migrations.CreateModel(
+ name='IshtarImage',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('image', models.ImageField(blank=True, max_length=255, null=True, upload_to=ishtar_common.models.get_image_path)),
+ ('thumbnail', models.ImageField(blank=True, max_length=255, null=True, upload_to=ishtar_common.models.get_image_path)),
+ ('name', models.CharField(max_length=250, verbose_name='Name')),
+ ('description', models.TextField(blank=True, null=True, verbose_name='Description')),
+ ('authors_raw', models.CharField(blank=True, max_length=250, null=True, verbose_name='Authors (raw)')),
+ ('creation_date', models.DateField(blank=True, null=True, verbose_name='Creation date')),
+ ('reference', models.CharField(blank=True, max_length=250, null=True, verbose_name='Ref.')),
+ ('internal_reference', models.CharField(blank=True, max_length=250, null=True, verbose_name='Internal ref.')),
+ ('authors', models.ManyToManyField(blank=True, to='ishtar_common.Author', verbose_name='Authors')),
+ ('image_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='ishtar_common.ImageType', verbose_name='Type')),
+ ],
+ options={
+ 'ordering': ('name',),
+ 'verbose_name': 'Image',
+ 'verbose_name_plural': 'Images',
+ },
+ ),
+ migrations.CreateModel(
+ name='LicenseType',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('label', models.CharField(max_length=100, verbose_name='Label')),
+ ('txt_idx', models.CharField(help_text='The slug is the standardized version of the name. It contains only lowercase letters, numbers and hyphens. Each slug must be unique.', max_length=100, unique=True, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')], verbose_name='Textual ID')),
+ ('comment', models.TextField(blank=True, null=True, verbose_name='Comment')),
+ ('available', models.BooleanField(default=True, verbose_name='Available')),
+ ],
+ options={
+ 'ordering': ('label',),
+ 'verbose_name': 'License type',
+ 'verbose_name_plural': 'License types',
+ },
+ bases=(ishtar_common.models.Cached, models.Model),
+ ),
+ migrations.AddField(
+ model_name='ishtarimage',
+ name='licenses',
+ field=models.ManyToManyField(blank=True, to='ishtar_common.LicenseType', verbose_name='License'),
+ ),
+ ]