Add cover_url to Book
This commit is contained in:
parent
5e7f9c94ce
commit
9d005daa09
|
@ -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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -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',
|
||||||
|
),
|
||||||
|
]
|
|
@ -4,6 +4,7 @@ from django.db import models
|
||||||
class Book(models.Model):
|
class Book(models.Model):
|
||||||
title = models.CharField(max_length=100)
|
title = models.CharField(max_length=100)
|
||||||
author = models.CharField(max_length=100)
|
author = models.CharField(max_length=100)
|
||||||
|
cover_url = models.URLField(null=True)
|
||||||
publisher = models.CharField(max_length=100)
|
publisher = models.CharField(max_length=100)
|
||||||
pub_date = models.DateField()
|
pub_date = models.DateField()
|
||||||
pages = models.IntegerField()
|
pages = models.IntegerField()
|
||||||
|
|
|
@ -11,6 +11,7 @@ class BookSerializer(serializers.ModelSerializer):
|
||||||
'id',
|
'id',
|
||||||
'title',
|
'title',
|
||||||
'author',
|
'author',
|
||||||
|
'cover_url',
|
||||||
'publisher',
|
'publisher',
|
||||||
'pub_date',
|
'pub_date',
|
||||||
'pages',
|
'pages',
|
||||||
|
|
Loading…
Reference in New Issue