Example #1
0
 def get(self,name):
     user = users.get_current_user()
     ganglion = Ganglion().all().filter('user ='******'name =', name)
     ganglion = ganglion.fetch(1)
     if not ganglion:
         self.redirect('/')
     else:
         ganglion = ganglion[0]
         if not ganglion.checkUser():
             self.error(404)
             return
         self.redirect('/ganglion/%s' % ganglion.key())
Example #2
0
 def post(self,key):
     user = users.get_current_user()
     ganglion = Ganglion().get(key)
     if not ganglion:
         logging.error("Cannot find ganglion %s" % key)
         return
     if not ganglion.checkUser():
         self.error(404)
         return
     #logging.debug("Sorting %s" % key)
     #logging.debug(repr(self.request.arguments()))
     order = 1
     for dumpKey in self.request.get_all('dump[]'):
         #logging.debug(dumpKey)
         dump = Dump.get(dumpKey)
         if dump:
             #logging.debug("order %s" % order)
             dump.order = order
             dump.put()
         order += 1
     #logging.debug("%s items sorted" % order)
     return
Example #3
0
 def get(self,key):
     user = users.get_current_user()
     cortex = getCortex(user)
     ganglion = Ganglion().get(key)
     if not ganglion:
         self.error(404)
         return
     if not ganglion.checkUser():
         self.error(404)
         return
     dumps = getDumps(ganglion)
     ganglia = Ganglion.all().filter('user ='******'name')
     someGanglia = ganglia.count() > 0
     logout = users.create_logout_url('/')
     write_template(self,'index.html', \
         { 'dumps': dumps,
           'ganglion': ganglion,
           'showChecked': cortex.showChecked,
           'dumpsTemplate': getDumpsTemplate(cortex),
           'ganglia': ganglia,
             'someGanglia':
             someGanglia,
             'user': user,
             'logout': logout})