|
|
|
@ -0,0 +1,37 @@ |
|
|
|
# Generated by Django 5.0.7 on 2024-08-09 11:18 |
|
|
|
|
|
|
|
import django.core.validators |
|
|
|
import django.db.models.deletion |
|
|
|
import gestion.models |
|
|
|
from django.db import migrations, models |
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration): |
|
|
|
|
|
|
|
dependencies = [ |
|
|
|
('gestion', '0002_autor_reymotauser_is_active_reymotauser_is_staff_and_more'), |
|
|
|
] |
|
|
|
|
|
|
|
operations = [ |
|
|
|
migrations.CreateModel( |
|
|
|
name='Autor', |
|
|
|
fields=[ |
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
|
|
('nombre', models.CharField(max_length=200)), |
|
|
|
('biografia', models.TextField(blank=True, null=True)), |
|
|
|
('foto', models.ImageField(blank=True, null=True, upload_to='autores/')), |
|
|
|
], |
|
|
|
), |
|
|
|
migrations.CreateModel( |
|
|
|
name='Libro', |
|
|
|
fields=[ |
|
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
|
|
|
('titulo', models.CharField(max_length=200)), |
|
|
|
('fecha_publicacion', models.PositiveBigIntegerField(default=2024, validators=[django.core.validators.MinValueValidator(1984), gestion.models.max_value_current_year])), |
|
|
|
('descripcion', models.TextField(blank=True, null=True)), |
|
|
|
('archivo', models.FileField(upload_to='libros/')), |
|
|
|
('portada', models.ImageField(blank=True, null=True, upload_to='portadas/')), |
|
|
|
('autor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='gestion.autor')), |
|
|
|
], |
|
|
|
), |
|
|
|
] |