python formatting
This commit is contained in:
parent
b1491c2ac6
commit
ee6f37d7d2
|
@ -55,6 +55,7 @@ class OrderedCollectionPage(ActivityObject):
|
||||||
@dataclass(init=False)
|
@dataclass(init=False)
|
||||||
class CollectionItem(ActivityObject):
|
class CollectionItem(ActivityObject):
|
||||||
""" an item in a collection """
|
""" an item in a collection """
|
||||||
|
|
||||||
actor: str
|
actor: str
|
||||||
type: str = "CollectionItem"
|
type: str = "CollectionItem"
|
||||||
|
|
||||||
|
@ -62,6 +63,7 @@ class CollectionItem(ActivityObject):
|
||||||
@dataclass(init=False)
|
@dataclass(init=False)
|
||||||
class ListItem(CollectionItem):
|
class ListItem(CollectionItem):
|
||||||
""" a book on a list """
|
""" a book on a list """
|
||||||
|
|
||||||
book: str
|
book: str
|
||||||
notes: str = None
|
notes: str = None
|
||||||
approved: bool = True
|
approved: bool = True
|
||||||
|
@ -72,5 +74,6 @@ class ListItem(CollectionItem):
|
||||||
@dataclass(init=False)
|
@dataclass(init=False)
|
||||||
class ShelfItem(CollectionItem):
|
class ShelfItem(CollectionItem):
|
||||||
""" a book on a list """
|
""" a book on a list """
|
||||||
|
|
||||||
book: str
|
book: str
|
||||||
type: str = "ShelfItem"
|
type: str = "ShelfItem"
|
||||||
|
|
|
@ -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(
|
item = models.ListItem.objects.create(
|
||||||
book_list=book_list,
|
book_list=book_list, book=self.book, user=self.local_user, approved=False
|
||||||
book=self.book,
|
|
||||||
user=self.local_user,
|
|
||||||
approved=False
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertFalse(item.approved)
|
self.assertFalse(item.approved)
|
||||||
|
|
Loading…
Reference in New Issue