# Generated by Django 3.2.25 on 2025-12-01 15:33

from django.db import migrations, models
import django.db.models.deletion
import mediautils.utils


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('sidebar', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='Titre du projet')),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('summary', models.CharField(help_text='Affiché sur la grille', max_length=250, verbose_name='Résumé court (Carte)')),
                ('description', models.TextField(help_text='Supporte le HTML simple ou texte brut', verbose_name='Description complète')),
                ('results', models.TextField(blank=True, help_text='Gains client, perfs, etc.', verbose_name='Résultats / Points clés')),
                ('cover_image', models.ImageField(upload_to=mediautils.utils.upload_to_projects, verbose_name='Image de couverture')),
                ('video_preview', models.FileField(blank=True, help_text='Vidéo courte jouée au survol de la carte', null=True, upload_to=mediautils.utils.upload_to_projects, verbose_name='Vidéo Preview (Hover)')),
                ('external_url', models.URLField(blank=True, verbose_name='Lien Démo / Site')),
                ('repo_url', models.URLField(blank=True, verbose_name='Lien GitHub / GitLab')),
                ('date', models.DateField(verbose_name='Date de réalisation')),
                ('is_featured', models.BooleanField(default=False, verbose_name='Mettre à la Une (Accueil)')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('order', models.PositiveIntegerField(default=0, verbose_name="Ordre d'affichage")),
            ],
            options={
                'verbose_name': 'Projet',
                'ordering': ['order', '-date'],
            },
        ),
        migrations.CreateModel(
            name='ProjectCategory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nom')),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('order', models.PositiveIntegerField(default=0)),
            ],
            options={
                'verbose_name': 'Catégorie Projet',
                'verbose_name_plural': 'Catégories Projets',
                'ordering': ['order', 'name'],
            },
        ),
        migrations.CreateModel(
            name='ProjectImage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to=mediautils.utils.upload_to_project_gallery)),
                ('caption', models.CharField(blank=True, max_length=100, verbose_name='Légende')),
                ('order', models.PositiveIntegerField(default=0)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gallery', to='projects.project')),
            ],
            options={
                'verbose_name': 'Image Galerie',
                'verbose_name_plural': 'Images Galerie',
                'ordering': ['order'],
            },
        ),
        migrations.AddField(
            model_name='project',
            name='category',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='projects', to='projects.projectcategory'),
        ),
        migrations.AddField(
            model_name='project',
            name='skills',
            field=models.ManyToManyField(blank=True, related_name='projects', to='sidebar.Skill', verbose_name='Technologies utilisées'),
        ),
    ]
