Show recent imports in a table
This commit is contained in:
parent
4806a6273e
commit
3c2f2c10bf
3 changed files with 56 additions and 14 deletions
|
@ -1,4 +1,5 @@
|
|||
""" track progress of goodreads imports """
|
||||
import math
|
||||
import re
|
||||
import dateutil.parser
|
||||
|
||||
|
@ -53,6 +54,12 @@ class ImportJob(models.Model):
|
|||
"""How many books do you want to import???"""
|
||||
return self.items.count()
|
||||
|
||||
@property
|
||||
def percent_complete(self):
|
||||
"""How far along?"""
|
||||
item_count = self.item_count
|
||||
return math.floor((item_count - self.pending_item_count) / item_count * 100)
|
||||
|
||||
@property
|
||||
def pending_item_count(self):
|
||||
"""And how many pending items??"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue