mirror of
https://github.com/franjsco/segnalibre-backend
synced 2025-02-16 11:31:36 +01:00
Add cover_url to Book
This commit is contained in:
parent
5e7f9c94ce
commit
9d005daa09
18
segnalibre_app/migrations/0009_book_cover.py
Normal file
18
segnalibre_app/migrations/0009_book_cover.py
Normal 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),
|
||||
),
|
||||
]
|
18
segnalibre_app/migrations/0010_auto_20191123_1356.py
Normal file
18
segnalibre_app/migrations/0010_auto_20191123_1356.py
Normal 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',
|
||||
),
|
||||
]
|
@ -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()
|
||||
|
@ -11,6 +11,7 @@ class BookSerializer(serializers.ModelSerializer):
|
||||
'id',
|
||||
'title',
|
||||
'author',
|
||||
'cover_url',
|
||||
'publisher',
|
||||
'pub_date',
|
||||
'pages',
|
||||
|
Loading…
x
Reference in New Issue
Block a user