Пример #1
0
 def POST(self):
     col_handler = self.col_handler('category')
     objs = col_handler.find().sort('id', pymongo.DESCENDING)
     form = cgform()
     if not form.validates():
         return render_to_response('category/manager_category', {
             'form':form,
             'objs':objs,
         })
     categroy = Category(form['name'].get_value())
     info = categroy.save()
     return web.seeother('/manager/category')
Пример #2
0
 def POST(self, id):
     form = cgform()
     if not form.validates():
         return render_to_response('category/manager_catedit', {
             'form':form,
             'fancybox':False
         })
     categroy = Category(form['name'].get_value(), id=int(id))
     info = categroy.save()
     fancybox = True
     return render_to_response('category/manager_catedit', {'form':form, 
         'fancybox':fancybox,
         })