Skip to content

Commit

Permalink
EDIT models.py & create media & covers directory
Browse files Browse the repository at this point in the history
  • Loading branch information
BrilliantPhoenix2024 committed Jul 27, 2022
1 parent b95417a commit 5591e51
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions books/migrations/0002_book_cover.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.6 on 2022-07-27 19:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('books', '0001_initial'),
]

operations = [
migrations.AddField(
model_name='book',
name='cover',
field=models.ImageField(blank=True, upload_to='covers/'),
),
]
1 change: 1 addition & 0 deletions books/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Book(models.Model):
author = models.CharField(max_length=200)
content = models.TextField()
price = models.DecimalField(max_digits=5, decimal_places=2)
cover = models.ImageField(upload_to='covers/', blank=True)

def __str__(self):
return self.title
Expand Down

0 comments on commit 5591e51

Please sign in to comment.