# Generated by Django 5.1.3 on 2024-12-08 23:31

import crimsonslate_portfolio.validators
import datetime
import django.core.files.storage
import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='MediaCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('cover', models.ImageField(blank=True, default=None, null=True, storage=django.core.files.storage.FileSystemStorage(), upload_to='category/', verbose_name='cover image')),
            ],
            options={
                'verbose_name': 'category',
                'verbose_name_plural': 'categories',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Media',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=64, unique=True)),
                ('source', models.FileField(storage=django.core.files.storage.FileSystemStorage(), upload_to='source/', validators=[crimsonslate_portfolio.validators.validate_media_file_extension])),
                ('thumb', models.ImageField(blank=True, default=None, null=True, storage=django.core.files.storage.FileSystemStorage(), upload_to='thumb/', verbose_name='thumbnail')),
                ('subtitle', models.CharField(blank=True, default=None, max_length=128, null=True)),
                ('desc', models.TextField(blank=True, default=None, max_length=2048, null=True, verbose_name='description')),
                ('slug', models.SlugField(blank=True, default=None, max_length=64, null=True, unique=True)),
                ('is_hidden', models.BooleanField(default=False)),
                ('is_image', models.BooleanField(blank=True, default=None, null=True)),
                ('date_created', models.DateField(default=datetime.date.today)),
                ('datetime_published', models.DateTimeField(default=django.utils.timezone.now)),
                ('categories', models.ManyToManyField(blank=True, default=None, to='crimsonslate_portfolio.mediacategory')),
            ],
            options={
                'ordering': ['date_created'],
                'constraints': [models.UniqueConstraint(fields=('title', 'slug'), name='crimsonslate_portfolio_media_unique_title_and_slug')],
            },
        ),
    ]
