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() }
def modded(self): """List of modded section slugs.""" return tools.take_first(self.sections.values_list("slug"))
def words(self): return tools.take_first(self.values_list("word"))