Example #1
0
 def post(self):
     text = self.request.get('dumptext')
     ganglionKey = self.request.get('ganglion')
     if ganglionKey:
         ganglion = Ganglion.get(ganglionKey)
     else:
         self.error(404)
         return
     if not ganglion.checkUser():
         self.error(404)
         return
     user = users.get_current_user()
     cortex = getCortex(user)
     if text:
         dump = Dump()
         dump.user = users.get_current_user()
         if ganglion and ganglion.user == user:
             dump.ganglion = ganglion
         dump.processNewText(text)
     dumps = getDumps(ganglion)
     write_template(self, getDumpsTemplate(cortex), \
         { 'dumps': dumps,
           'showChecked': cortex.showChecked,
           'ganglion': ganglion,
           'user': user, })
Example #2
0
 def post(self):
     logging.debug('ToggleChecked ' + repr(self.request.arguments()))
     toggle = self.request.get('toggle')
     user = users.get_current_user()
     cortex = getCortex(user)
     if toggle == "hide":
         cortex.showChecked = False
     elif toggle == "show":
         cortex.showChecked = True
     else:
         self.error(404)
         return
     cortex.put()
     key = self.request.get('key')
     if not key: 
         self.error(404)
         return
     ganglion = Ganglion.get(key)
     if not ganglion: 
         self.error(404)
         return
     if not ganglion.checkUser():
         self.error(404)
         return
     dumps = getDumps(ganglion)
     write_template(self, getDumpsTemplate(cortex), \
         { 'dumps': dumps,
           'ganglion': ganglion,
           'showChecked': cortex.showChecked,
           'user': user, })
Example #3
0
 def post(self):
     key = self.request.get('key')
     if not key: 
         self.error(404)
         return
     ganglion = Ganglion.get(key)
     if not ganglion: 
         self.error(404)
         return
     if not ganglion.checkUser():
         self.error(404)
         return
     user = users.get_current_user()
     cortex = getCortex(user)
     cortex.default = ganglion
     cortex.put()
Example #4
0
 def post(self):
     key = self.request.get('key')
     if not key: 
         self.error(404)
         return
     update_value = self.request.get('update_value')
     if not update_value: 
         self.error(404)
         return
     ganglion = Ganglion.get(key)
     if not ganglion: 
         self.error(404)
         return
     if not ganglion.checkUser():
         self.error(404)
         return
     ganglion.name = update_value
     ganglion.put()
     self.response.out.write(ganglion.name)
Example #5
0
 def post(self,view):
     user = users.get_current_user()
     cortex = getCortex(user)
     cortex.viewMode = view
     cortex.put()
     ganglionKey = self.request.get('ganglion')
     ganglion = None
     if not ganglionKey: 
         self.error(404)
         return
     ganglion = Ganglion.get(ganglionKey)
     if not ganglion: 
         self.error(404)
         return
     if not ganglion.checkUser():
         self.error(404)
         return
     dumps = getDumps(ganglion)
     write_template(self, getDumpsTemplate(cortex), \
         { 'dumps': dumps,
           'ganglion': ganglion,
           'user': user, })