0001_initial.py 5.57 KB
# Generated by Django 4.1.9 on 2023-09-21 13:18

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Precio",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("precio", models.FloatField(max_length=50)),
                ("vigencia_desde", models.DateField()),
                ("vigencia_hasta", models.DateField(blank=True, null=True)),
                (
                    "moneda",
                    models.CharField(
                        choices=[
                            ("peso_argentino", "peso_argentino"),
                            ("dolar", "dolar"),
                            ("euro", "euro"),
                        ],
                        default="peso_argentino",
                        max_length=50,
                    ),
                ),
                ("precio_ejemplar", models.FloatField(max_length=50)),
                (
                    "usuario",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Precio",
                "verbose_name_plural": "Precios",
            },
        ),
        migrations.CreateModel(
            name="Edicto",
            fields=[
                (
                    "uuid",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        serialize=False,
                        unique=True,
                    ),
                ),
                ("cuerpo_edicto", models.TextField()),
                ("archivo", models.FileField(upload_to="uploads/%Y/%m/%d/")),
                ("dias_publicar", models.PositiveIntegerField()),
                ("cantidad_sellos", models.PositiveIntegerField()),
                (
                    "estado",
                    models.CharField(
                        choices=[
                            ("iniciado", "iniciado"),
                            ("pendiente_revision", "pendiente_revision"),
                            ("pendiente_de_pago", "pendiente_de_pago"),
                            ("pendiente_pago_revision", "pendiente_pago_revision"),
                            ("publicado", "publicado"),
                            ("aprobado", "aprobado"),
                            ("rechazado", "rechazado"),
                        ],
                        default="inciado",
                        max_length=23,
                    ),
                ),
                ("cantidad_palabras", models.IntegerField(editable=False)),
                ("cantidad_copias", models.PositiveIntegerField()),
                ("observaciones", models.CharField(blank=True, max_length=500)),
                ("fecha_publicacion", models.DateField(blank=True, null=True)),
                ("fecha_creacion", models.DateField(auto_now_add=True)),
                ("fecha_modificacion", models.DateTimeField(auto_now=True)),
                (
                    "creado_por",
                    models.ForeignKey(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Usuario",
                    ),
                ),
                (
                    "modificado_por",
                    models.ForeignKey(
                        editable=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="update_edicto",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Edicto",
                "verbose_name_plural": "Edictos",
            },
        ),
        migrations.CreateModel(
            name="ComprobantePago",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("monto", models.FloatField()),
                (
                    "numero_comprobante",
                    models.CharField(blank=True, max_length=300, null=True),
                ),
                ("fecha_pago", models.DateTimeField(blank=True, null=True)),
                (
                    "archivo",
                    models.FileField(blank=True, upload_to="uploads/%Y/%m/%d/"),
                ),
                (
                    "edicto",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE, to="edicto.edicto"
                    ),
                ),
            ],
            options={
                "verbose_name": "ComprobantePago",
                "verbose_name_plural": "ComprobantesPagos",
            },
        ),
    ]