Add cover_url to Book

This commit is contained in:
Francesco Esposito 2019-11-23 13:59:11 +01:00
parent 5e7f9c94ce
commit 9d005daa09
4 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 2.2.7 on 2019-11-23 12:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('segnalibre_app', '0008_delete_bookmark'),
]
operations = [
migrations.AddField(
model_name='book',
name='cover',
field=models.URLField(null=True),
),
]

View File

@ -0,0 +1,18 @@
# Generated by Django 2.2.7 on 2019-11-23 12:56
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('segnalibre_app', '0009_book_cover'),
]
operations = [
migrations.RenameField(
model_name='book',
old_name='cover',
new_name='cover_url',
),
]

View File

@ -4,6 +4,7 @@ from django.db import models
class Book(models.Model):
title = models.CharField(max_length=100)
author = models.CharField(max_length=100)
cover_url = models.URLField(null=True)
publisher = models.CharField(max_length=100)
pub_date = models.DateField()
pages = models.IntegerField()

View File

@ -11,6 +11,7 @@ class BookSerializer(serializers.ModelSerializer):
'id',
'title',
'author',
'cover_url',
'publisher',
'pub_date',
'pages',