Exemple #1
0
 def count(self, limit=5):
     """Returns dict, that contains info about thread files and posts."""
     ps = self.posts()
     total = ps.count()
     if total <= limit:
         return {"total": total, "skipped": 0, "skipped_files": 0}
     start = total - limit
     skipped_ids = tools.take_first(ps[1:start].values_list("id"))
     return {
         "total": total,
         "start": start,
         "stop": total,
         "skipped": start - 1,
         "skipped_files": ps.filter(id__in=skipped_ids, file=True).count()
     }
Exemple #2
0
 def count(self, limit=5):
     """Returns dict, that contains info about thread files and posts."""
     ps = self.posts()
     total = ps.count()
     if total <= limit:
         return {"total": total, "skipped": 0, "skipped_files": 0}
     start = total - limit
     skipped_ids = tools.take_first(ps[1:start].values_list("id"))
     return {
         "total": total,
         "start": start,
         "stop": total,
         "skipped": start - 1,
         "skipped_files": ps.filter(id__in=skipped_ids, file=True).count()
     }
Exemple #3
0
 def modded(self):
     """List of modded section slugs."""
     return tools.take_first(self.sections.values_list("slug"))
Exemple #4
0
 def words(self):
     return tools.take_first(self.values_list("word"))
Exemple #5
0
 def modded(self):
     """List of modded section slugs."""
     return tools.take_first(self.sections.values_list("slug"))
Exemple #6
0
 def words(self):
     return tools.take_first(self.values_list("word"))