1# -*- coding: utf-8 -*- 2from __future__ import unicode_literals 3 4from django.db import models, migrations 5import photologue.models 6import django.utils.timezone 7import django.core.validators 8import sortedm2m.fields 9 10 11class Migration(migrations.Migration): 12 13 dependencies = [ 14 ('sites', '0001_initial'), 15 ] 16 17 operations = [ 18 migrations.CreateModel( 19 name='Gallery', 20 fields=[ 21 ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), 22 ('date_added', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date published')), 23 ('title', models.CharField(max_length=50, verbose_name='title', unique=True)), 24 ('slug', models.SlugField(help_text='A "slug" is a unique URL-friendly title for an object.', verbose_name='title slug', unique=True)), 25 ('description', models.TextField(blank=True, verbose_name='description')), 26 ('is_public', models.BooleanField(help_text='Public galleries will be displayed in the default views.', verbose_name='is public', default=True)), 27 ('tags', photologue.models.TagField(max_length=255, help_text='Django-tagging was not found, tags will be treated as plain text.', blank=True, verbose_name='tags')), 28 ('sites', models.ManyToManyField(blank=True, verbose_name='sites', null=True, to='sites.Site')), 29 ], 30 options={ 31 'get_latest_by': 'date_added', 32 'verbose_name': 'gallery', 33 'ordering': ['-date_added'], 34 'verbose_name_plural': 'galleries', 35 }, 36 bases=(models.Model,), 37 ), 38 migrations.CreateModel( 39 name='GalleryUpload', 40 fields=[ 41 ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), 42 ('zip_file', models.FileField(help_text='Select a .zip file of images to upload into a new Gallery.', verbose_name='images file (.zip)', upload_to='photologue/temp')), 43 ('title', models.CharField(max_length=50, help_text='All uploaded photos will be given a title made up of this title + a sequential number.', verbose_name='title')), 44 ('caption', models.TextField(help_text='Caption will be added to all photos.', blank=True, verbose_name='caption')), 45 ('description', models.TextField(help_text='A description of this Gallery.', blank=True, verbose_name='description')), 46 ('is_public', models.BooleanField(help_text='Uncheck this to make the uploaded gallery and included photographs private.', verbose_name='is public', default=True)), 47 ('tags', models.CharField(max_length=255, help_text='Django-tagging was not found, tags will be treated as plain text.', blank=True, verbose_name='tags')), 48 ('gallery', models.ForeignKey(blank=True, verbose_name='gallery', null=True, help_text='Select a gallery to add these images to. Leave this empty to create a new gallery from the supplied title.', to='photologue.Gallery', on_delete=models.CASCADE)), 49 ], 50 options={ 51 'verbose_name': 'gallery upload', 52 'verbose_name_plural': 'gallery uploads', 53 }, 54 bases=(models.Model,), 55 ), 56 migrations.CreateModel( 57 name='Photo', 58 fields=[ 59 ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), 60 ('image', models.ImageField(upload_to=photologue.models.get_storage_path, verbose_name='image')), 61 ('date_taken', models.DateTimeField(verbose_name='date taken', blank=True, editable=False, null=True)), 62 ('view_count', models.PositiveIntegerField(verbose_name='view count', default=0, editable=False)), 63 ('crop_from', models.CharField(max_length=10, default='center', blank=True, verbose_name='crop from', choices=[('top', 'Top'), ('right', 'Right'), ('bottom', 'Bottom'), ('left', 'Left'), ('center', 'Center (Default)')])), 64 ('title', models.CharField(max_length=50, verbose_name='title', unique=True)), 65 ('slug', models.SlugField(help_text='A "slug" is a unique URL-friendly title for an object.', verbose_name='slug', unique=True)), 66 ('caption', models.TextField(blank=True, verbose_name='caption')), 67 ('date_added', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date added')), 68 ('is_public', models.BooleanField(help_text='Public photographs will be displayed in the default views.', verbose_name='is public', default=True)), 69 ('tags', photologue.models.TagField(max_length=255, help_text='Django-tagging was not found, tags will be treated as plain text.', blank=True, verbose_name='tags')), 70 ('sites', models.ManyToManyField(blank=True, verbose_name='sites', null=True, to='sites.Site')), 71 ], 72 options={ 73 'get_latest_by': 'date_added', 74 'verbose_name': 'photo', 75 'ordering': ['-date_added'], 76 'verbose_name_plural': 'photos', 77 }, 78 bases=(models.Model,), 79 ), 80 migrations.AddField( 81 model_name='gallery', 82 name='photos', 83 field=sortedm2m.fields.SortedManyToManyField(blank=True, verbose_name='photos', null=True, to='photologue.Photo'), 84 preserve_default=True, 85 ), 86 migrations.CreateModel( 87 name='PhotoEffect', 88 fields=[ 89 ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), 90 ('name', models.CharField(max_length=30, verbose_name='name', unique=True)), 91 ('description', models.TextField(blank=True, verbose_name='description')), 92 ('transpose_method', models.CharField(max_length=15, blank=True, verbose_name='rotate or flip', choices=[('FLIP_LEFT_RIGHT', 'Flip left to right'), ('FLIP_TOP_BOTTOM', 'Flip top to bottom'), ('ROTATE_90', 'Rotate 90 degrees counter-clockwise'), ('ROTATE_270', 'Rotate 90 degrees clockwise'), ('ROTATE_180', 'Rotate 180 degrees')])), 93 ('color', models.FloatField(help_text='A factor of 0.0 gives a black and white image, a factor of 1.0 gives the original image.', verbose_name='color', default=1.0)), 94 ('brightness', models.FloatField(help_text='A factor of 0.0 gives a black image, a factor of 1.0 gives the original image.', verbose_name='brightness', default=1.0)), 95 ('contrast', models.FloatField(help_text='A factor of 0.0 gives a solid grey image, a factor of 1.0 gives the original image.', verbose_name='contrast', default=1.0)), 96 ('sharpness', models.FloatField(help_text='A factor of 0.0 gives a blurred image, a factor of 1.0 gives the original image.', verbose_name='sharpness', default=1.0)), 97 ('filters', models.CharField(max_length=200, help_text='Chain multiple filters using the following pattern "FILTER_ONE->FILTER_TWO->FILTER_THREE". Image filters will be applied in order. The following filters are available: BLUR, CONTOUR, DETAIL, EDGE_ENHANCE, EDGE_ENHANCE_MORE, EMBOSS, FIND_EDGES, SHARPEN, SMOOTH, SMOOTH_MORE.', blank=True, verbose_name='filters')), 98 ('reflection_size', models.FloatField(help_text='The height of the reflection as a percentage of the orignal image. A factor of 0.0 adds no reflection, a factor of 1.0 adds a reflection equal to the height of the orignal image.', verbose_name='size', default=0)), 99 ('reflection_strength', models.FloatField(help_text='The initial opacity of the reflection gradient.', verbose_name='strength', default=0.6)), 100 ('background_color', models.CharField(max_length=7, help_text='The background color of the reflection gradient. Set this to match the background color of your page.', verbose_name='color', default='#FFFFFF')), 101 ], 102 options={ 103 'verbose_name': 'photo effect', 104 'verbose_name_plural': 'photo effects', 105 }, 106 bases=(models.Model,), 107 ), 108 migrations.AddField( 109 model_name='photo', 110 name='effect', 111 field=models.ForeignKey(blank=True, verbose_name='effect', null=True, to='photologue.PhotoEffect', on_delete=models.CASCADE), 112 preserve_default=True, 113 ), 114 migrations.CreateModel( 115 name='PhotoSize', 116 fields=[ 117 ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), 118 ('name', models.CharField(max_length=40, help_text='Photo size name should contain only letters, numbers and underscores. Examples: "thumbnail", "display", "small", "main_page_widget".', verbose_name='name', unique=True, validators=[django.core.validators.RegexValidator(regex='^[a-z0-9_]+$', message='Use only plain lowercase letters (ASCII), numbers and underscores.')])), 119 ('width', models.PositiveIntegerField(help_text='If width is set to "0" the image will be scaled to the supplied height.', verbose_name='width', default=0)), 120 ('height', models.PositiveIntegerField(help_text='If height is set to "0" the image will be scaled to the supplied width', verbose_name='height', default=0)), 121 ('quality', models.PositiveIntegerField(help_text='JPEG image quality.', verbose_name='quality', choices=[(30, 'Very Low'), (40, 'Low'), (50, 'Medium-Low'), (60, 'Medium'), (70, 'Medium-High'), (80, 'High'), (90, 'Very High')], default=70)), 122 ('upscale', models.BooleanField(help_text='If selected the image will be scaled up if necessary to fit the supplied dimensions. Cropped sizes will be upscaled regardless of this setting.', verbose_name='upscale images?', default=False)), 123 ('crop', models.BooleanField(help_text='If selected the image will be scaled and cropped to fit the supplied dimensions.', verbose_name='crop to fit?', default=False)), 124 ('pre_cache', models.BooleanField(help_text='If selected this photo size will be pre-cached as photos are added.', verbose_name='pre-cache?', default=False)), 125 ('increment_count', models.BooleanField(help_text='If selected the image\'s "view_count" will be incremented when this photo size is displayed.', verbose_name='increment view count?', default=False)), 126 ('effect', models.ForeignKey(blank=True, verbose_name='photo effect', null=True, to='photologue.PhotoEffect', on_delete=models.CASCADE)), 127 ], 128 options={ 129 'verbose_name': 'photo size', 130 'ordering': ['width', 'height'], 131 'verbose_name_plural': 'photo sizes', 132 }, 133 bases=(models.Model,), 134 ), 135 migrations.CreateModel( 136 name='Watermark', 137 fields=[ 138 ('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)), 139 ('name', models.CharField(max_length=30, verbose_name='name', unique=True)), 140 ('description', models.TextField(blank=True, verbose_name='description')), 141 ('image', models.ImageField(upload_to='photologue/watermarks', verbose_name='image')), 142 ('style', models.CharField(max_length=5, default='scale', verbose_name='style', choices=[('tile', 'Tile'), ('scale', 'Scale')])), 143 ('opacity', models.FloatField(help_text='The opacity of the overlay.', verbose_name='opacity', default=1)), 144 ], 145 options={ 146 'verbose_name': 'watermark', 147 'verbose_name_plural': 'watermarks', 148 }, 149 bases=(models.Model,), 150 ), 151 migrations.AddField( 152 model_name='photosize', 153 name='watermark', 154 field=models.ForeignKey(blank=True, verbose_name='watermark image', null=True, to='photologue.Watermark', on_delete=models.CASCADE), 155 preserve_default=True, 156 ), 157 ] 158