diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index 6cc81c04..3b3751ee 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -76,7 +76,16 @@ class ReviewForm(CustomForm): class CommentForm(CustomForm): class Meta: model = models.Comment - fields = ["user", "book", "content", "content_warning", "sensitive", "privacy", "progress", "mode"] + fields = [ + "user", + "book", + "content", + "content_warning", + "sensitive", + "privacy", + "progress", + "mode", + ] class QuotationForm(CustomForm): diff --git a/bookwyrm/migrations/0055_auto_20210321_0025.py b/bookwyrm/migrations/0055_auto_20210321_0025.py index 446181f9..d7b4b518 100644 --- a/bookwyrm/migrations/0055_auto_20210321_0025.py +++ b/bookwyrm/migrations/0055_auto_20210321_0025.py @@ -7,18 +7,28 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('bookwyrm', '0054_auto_20210319_1942'), + ("bookwyrm", "0054_auto_20210319_1942"), ] operations = [ migrations.AddField( - model_name='comment', - name='mode', - field=models.CharField(blank=True, choices=[('PG', 'page'), ('PCT', 'percent')], default='PG', max_length=3, null=True), + model_name="comment", + name="mode", + field=models.CharField( + blank=True, + choices=[("PG", "page"), ("PCT", "percent")], + default="PG", + max_length=3, + null=True, + ), ), migrations.AddField( - model_name='comment', - name='progress', - field=models.IntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(0)]), + model_name="comment", + name="progress", + field=models.IntegerField( + blank=True, + null=True, + validators=[django.core.validators.MinValueValidator(0)], + ), ), ] diff --git a/bookwyrm/models/readthrough.py b/bookwyrm/models/readthrough.py index b76b9022..1a5fcb0d 100644 --- a/bookwyrm/models/readthrough.py +++ b/bookwyrm/models/readthrough.py @@ -8,6 +8,7 @@ from .base_model import BookWyrmModel class ProgressMode(models.TextChoices): """ types of prgress available """ + PAGE = "PG", "page" PERCENT = "PCT", "percent" diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 60c00f5a..9db67726 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -232,9 +232,15 @@ class Comment(Status): # this is it's own field instead of a foreign key to the progress update # so that the update can be deleted without impacting the status - progress = models.IntegerField(validators=[MinValueValidator(0)], null=True, blank=True) + progress = models.IntegerField( + validators=[MinValueValidator(0)], null=True, blank=True + ) mode = models.CharField( - max_length=3, choices=ProgressMode.choices, default=ProgressMode.PAGE, null=True, blank=True + max_length=3, + choices=ProgressMode.choices, + default=ProgressMode.PAGE, + null=True, + blank=True, ) @property