def addTasks(self): q = Comic.all() queue = Queue(name='update-queue') tasks = [] for comic in q: if len(tasks) >= 100: queue.add(tasks) tasks = [] else: task = Task(url='/tasks/update/' + str(comic.id)) tasks.append(task) self.response.out.write("OK")
def get(self): user = users.get_current_user() if user: comics = Comic.all() text = self.request.get('input') if users.is_current_user_admin(): role = "Dibujante" else: role = "Lector" self.render_template( 'adds.html', { 'comics': comics, 'input': text, 'user': user, 'role': role, 'logout': users.create_logout_url('/') }) else: self.redirect(users.create_login_url(self.request.uri))
def get(self): q = Comic.all() q.order("name") self.render("list_all.js", { 'comics': q})
def get(self): q = Comic.all() q.order("name") self.render("list_all.js", {'comics': q})