59 lines
1.9 KiB
Python
59 lines
1.9 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.10.5 on 2017-02-22 20:55
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations, models
|
|
import django.utils.timezone
|
|
import stdimage.models
|
|
import stdimage.utils
|
|
import stdimage.validators
|
|
import dynamic_filenames
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [("base", "0002_auto_20170214_1911")]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="BannerImage",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.AutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("url", models.URLField()),
|
|
("title", models.CharField(max_length=255)),
|
|
("displayed", models.BooleanField(default=True)),
|
|
(
|
|
"original_image",
|
|
models.URLField(blank=True, max_length=255, null=True),
|
|
),
|
|
(
|
|
"scaled_image",
|
|
stdimage.models.StdImageField(
|
|
blank=True,
|
|
null=True,
|
|
upload_to=dynamic_filenames.FilePattern(
|
|
filename_pattern="{model_name}/{instance.title:slug}{ext}"
|
|
),
|
|
validators=[
|
|
stdimage.validators.MinSizeValidator(1200, 300)
|
|
],
|
|
),
|
|
),
|
|
("caption", models.TextField()),
|
|
(
|
|
"date",
|
|
models.DateTimeField(default=django.utils.timezone.now),
|
|
),
|
|
],
|
|
),
|
|
migrations.DeleteModel(name="BannerImages"),
|
|
]
|