# Generated by Django 4.2.1 on 2023-05-24 21:01

from django.conf import settings
import django.contrib.sites.managers
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sites', '0002_alter_domain_unique'),
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fullname', models.CharField(blank=True, max_length=100)),
                ('url', models.URLField(blank=True)),
                ('avatar', models.ImageField(blank=True, height_field='avatar_height', upload_to='avatars', width_field='avatar_width')),
                ('about', models.TextField(blank=True)),
                ('avatar_height', models.IntegerField(blank=True, null=True)),
                ('avatar_width', models.IntegerField(blank=True, null=True)),
                ('remote_access_enabled', models.BooleanField(default=False)),
                ('remote_access_key', models.CharField(blank=True, max_length=100, validators=[django.core.validators.MinLengthValidator(8)])),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Blog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=100)),
                ('description', models.TextField(blank=True)),
                ('slug', models.SlugField(max_length=100)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('site', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sites.site')),
            ],
            managers=[
                ('objects', django.db.models.manager.Manager()),
                ('on_site', django.contrib.sites.managers.CurrentSiteManager()),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('description', models.CharField(blank=True, max_length=100)),
                ('slug', models.SlugField(max_length=100)),
                ('blog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xblog.blog')),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=100)),
                ('slug', models.SlugField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pub_date', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('update_date', models.DateTimeField(auto_now=True)),
                ('create_date', models.DateTimeField(auto_now_add=True)),
                ('enable_comments', models.BooleanField(default=True)),
                ('title', models.CharField(max_length=255)),
                ('slug', models.SlugField(max_length=100)),
                ('guid', models.CharField(blank=True, max_length=255)),
                ('body', models.TextField(blank=True)),
                ('summary', models.TextField(blank=True)),
                ('status', models.CharField(blank=True, choices=[('draft', 'Draft'), ('publish', 'Published'), ('private', 'Private')], default='Draft', max_length=32, null=True)),
                ('text_filter', models.CharField(blank=True, choices=[('markdown', 'Markdown'), ('html', 'HTML'), ('convert linebreaks', 'Convert linebreaks'), ('__default__', 'Default (HTML)')], default='__default__', max_length=100)),
                ('post_format', models.CharField(blank=True, choices=[('standard', 'Standard'), ('video', 'Video'), ('status', 'Status')], default='standard', max_length=100)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xblog.author')),
                ('blog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xblog.blog')),
                ('categories', models.ManyToManyField(related_name='posts', to='xblog.category')),
                ('primary_category_name', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='primary_category_set', to='xblog.category')),
                ('tags', models.ManyToManyField(blank=True, related_name='posts', to='xblog.tag')),
            ],
        ),
        migrations.CreateModel(
            name='Pingback',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('author_name', models.CharField(blank=True, max_length=100)),
                ('author_email', models.EmailField(blank=True, max_length=254)),
                ('title', models.CharField(blank=True, max_length=255)),
                ('body', models.TextField(blank=True)),
                ('is_public', models.BooleanField(default=False)),
                ('source_url', models.URLField(blank=True)),
                ('target_url', models.URLField(blank=True)),
                ('pub_date', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('mod_date', models.DateTimeField(blank=True, default=django.utils.timezone.now)),
                ('post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xblog.post')),
            ],
        ),
        migrations.CreateModel(
            name='LinkCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=255)),
                ('description', models.TextField(blank=True)),
                ('visible', models.BooleanField(default=True)),
                ('display_order', models.IntegerField(blank=True, null=True)),
                ('blog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xblog.blog')),
            ],
        ),
        migrations.CreateModel(
            name='Link',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.URLField(blank=True)),
                ('link_name', models.CharField(blank=True, max_length=255)),
                ('link_image', models.ImageField(blank=True, height_field='link_image_height', upload_to='blog_uploads/links/', width_field='link_image_width')),
                ('link_image_height', models.IntegerField(blank=True, null=True)),
                ('link_image_width', models.IntegerField(blank=True, null=True)),
                ('description', models.TextField(blank=True)),
                ('visible', models.BooleanField(default=True)),
                ('rss', models.URLField(blank=True)),
                ('blog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xblog.blog')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='xblog.linkcategory')),
            ],
        ),
    ]
