Formatting

This commit is contained in:
Mouse Reeve
2021-03-20 17:39:05 -07:00
parent dd15e87073
commit 2a612f7278
4 changed files with 36 additions and 10 deletions

View File

@ -8,6 +8,7 @@ from .base_model import BookWyrmModel
class ProgressMode(models.TextChoices):
""" types of prgress available """
PAGE = "PG", "page"
PERCENT = "PCT", "percent"

View File

@ -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