# Generated by Django 5.1.3 on 2024-11-15 07:42

import django.db.models.deletion
import utils.models
import utils.upload
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='FileGroupObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FileUserObjectPermission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Thumbnail',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('source', utils.models.NoPillowPictureField(aspect_ratios=[None, '1/1', '4/3', '16/9'], breakpoints={'lg': 992, 'md': 768, 'sm': 576, 'xl': 1200, 'xs': 0, 'xxl': 1400}, container_width=200, file_types=['WEBP'], grid_columns=4, height_field='height', help_text='The source image from which all the thumbnails are created.', max_length=255, pixel_densities=[1, 2], upload_to=utils.upload.get_thumbnail_source_path, width_field='width')),
                ('width', models.PositiveIntegerField(help_text='The width of the thumbnail source (in pixels).')),
                ('height', models.PositiveIntegerField(help_text='The height of the thumbnail source (in pixels).')),
                ('mimetype', models.CharField(help_text='The mimetype of the thumbnail source image as reported by the uploading client.', max_length=255)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BaseFile',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, help_text='The unique ID (UUID4) of this object.', primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True, help_text='The date and time when this object was first created.')),
                ('updated', models.DateTimeField(auto_now=True, help_text='The date and time when this object was last updated.')),
                ('title', models.CharField(help_text='The title of this work. Required. Defaults to the original uploaded filename.', max_length=255)),
                ('description', models.TextField(blank=True, help_text='The description of this work. Optional. Supports markdown.')),
                ('original_source', models.URLField(blank=True, help_text='The URL to the original source of this work. Leave blank to consider the BMA URL the original source.')),
                ('license', models.CharField(choices=[('CC_ZERO_1_0', 'Creative Commons CC0 1.0 Universal'), ('CC_BY_4_0', 'Creative Commons Attribution 4.0 International'), ('CC_BY_SA_4_0', 'Creative Commons Attribution-ShareAlike 4.0 International')], help_text='The license for this file. The license can not be changed after the file(s) is uploaded.', max_length=255)),
                ('attribution', models.CharField(help_text='The attribution text for this file. This is usually the real name or handle of the author(s) or licensor of the file.', max_length=255)),
                ('approved', models.BooleanField(default=False, help_text='Has this file been approved by a moderator?')),
                ('published', models.BooleanField(default=False, help_text='Has this file been published?')),
                ('deleted', models.BooleanField(default=False, help_text='Has this file been deleted?')),
                ('original_filename', models.CharField(help_text='The original (uploaded) filename. This value is read-only.', max_length=255)),
                ('file_size', models.PositiveIntegerField(help_text='The size of the file in bytes. This value is read-only.')),
                ('mimetype', models.CharField(help_text='The mimetype of the original (uploaded) file as reported by the uploading client. This value is read-only.', max_length=255)),
                ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_%(app_label)s.%(class)s_set+', to='contenttypes.contenttype')),
            ],
            options={
                'verbose_name': 'file',
                'verbose_name_plural': 'files',
                'ordering': ('created',),
                'permissions': (('unapprove_basefile', 'Unapprove file'), ('approve_basefile', 'Approve file'), ('unpublish_basefile', 'Unpublish file'), ('publish_basefile', 'Publish file'), ('undelete_basefile', 'Undelete file'), ('softdelete_basefile', 'Soft delete file')),
            },
        ),
    ]
