Move progress updates into modal
This commit is contained in:
parent
9b51ed40c8
commit
942c4a6664
9 changed files with 101 additions and 42 deletions
|
@ -7,6 +7,7 @@ from .base_model import BookWyrmModel
|
|||
|
||||
|
||||
class ProgressMode(models.TextChoices):
|
||||
""" types of prgress available """
|
||||
PAGE = "PG", "page"
|
||||
PERCENT = "PCT", "percent"
|
||||
|
||||
|
@ -32,10 +33,12 @@ class ReadThrough(BookWyrmModel):
|
|||
super().save(*args, **kwargs)
|
||||
|
||||
def create_update(self):
|
||||
""" add update to the readthrough """
|
||||
if self.progress:
|
||||
return self.progressupdate_set.create(
|
||||
user=self.user, progress=self.progress, mode=self.progress_mode
|
||||
)
|
||||
return None
|
||||
|
||||
|
||||
class ProgressUpdate(BookWyrmModel):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue