예제 #1
0
 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")
예제 #2
0
 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")
예제 #3
0
 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))
예제 #4
0
 def get(self):
     q = Comic.all()
     q.order("name")
     self.render("list_all.js", { 'comics': q})
예제 #5
0
 def get(self):
     q = Comic.all()
     q.order("name")
     self.render("list_all.js", {'comics': q})