def get(self, *args, **kwargs): self.set_cookie('index-mode', self._mode) tasks = Task.assigned_tasks(user_id=self.user.id) # num = Task.number(assigned_id=self.user.id, status__le=Task._status_assigned) # paginator = Paginator(page, num, Task._per_page) auths = Auth.find_user_projects(self.user.id) return self.render('index.html', datas=tasks, auths=auths, paginator=None, page=0)
def get(self, *args, **kwargs): self.set_cookie('index-mode', self._mode) page = self.get_args('p', 1, int) focuses = TaskFocus.user_focs(user_id=self.user.id, page=page) for f in focuses: f.task = Task.get(id=f.task_id) num = TaskFocus.number(user_id=self.user.id) paginator = Paginator(page, num, TaskFocus._per_page) #auths auths = Auth.find_user_projects(self.user.id) return self.render('index.html', datas=focuses, auths=auths, paginator=paginator, page=page)