mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-20 07:06:41 +00:00
python formatting
This commit is contained in:
parent
b1491c2ac6
commit
ee6f37d7d2
3 changed files with 32 additions and 4 deletions
|
@ -55,6 +55,7 @@ class OrderedCollectionPage(ActivityObject):
|
|||
@dataclass(init=False)
|
||||
class CollectionItem(ActivityObject):
|
||||
""" an item in a collection """
|
||||
|
||||
actor: str
|
||||
type: str = "CollectionItem"
|
||||
|
||||
|
@ -62,6 +63,7 @@ class CollectionItem(ActivityObject):
|
|||
@dataclass(init=False)
|
||||
class ListItem(CollectionItem):
|
||||
""" a book on a list """
|
||||
|
||||
book: str
|
||||
notes: str = None
|
||||
approved: bool = True
|
||||
|
@ -72,5 +74,6 @@ class ListItem(CollectionItem):
|
|||
@dataclass(init=False)
|
||||
class ShelfItem(CollectionItem):
|
||||
""" a book on a list """
|
||||
|
||||
book: str
|
||||
type: str = "ShelfItem"
|
||||
|
|
28
bookwyrm/migrations/0064_auto_20210408_2208.py
Normal file
28
bookwyrm/migrations/0064_auto_20210408_2208.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Generated by Django 3.1.6 on 2021-04-08 22:08
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("bookwyrm", "0063_auto_20210408_1556"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="listitem",
|
||||
name="book_list",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE, to="bookwyrm.list"
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="shelfbook",
|
||||
name="shelf",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.PROTECT, to="bookwyrm.shelf"
|
||||
),
|
||||
),
|
||||
]
|
|
@ -65,10 +65,7 @@ class List(TestCase):
|
|||
)
|
||||
|
||||
item = models.ListItem.objects.create(
|
||||
book_list=book_list,
|
||||
book=self.book,
|
||||
user=self.local_user,
|
||||
approved=False
|
||||
book_list=book_list, book=self.book, user=self.local_user, approved=False
|
||||
)
|
||||
|
||||
self.assertFalse(item.approved)
|
||||
|
|
Loading…
Reference in a new issue