Exemple #1
0
 def POST(self, id):
     form = linkform()
     if not form.validates():
         return render_to_response('category/manager_linkedit', {
             'form':form,
             'fancybox':False,
         })
     link = Link(form['link_addr'].get_value(), 
         form['link_name'].get_value(),
         form['friend_name'].get_value(),
         form['description'].get_value(),
         id=int(id))
     info = link.save()
     fancybox = True
     return render_to_response('category/manager_linkedit', {'form':form, 
         'fancybox':fancybox,
         })            
Exemple #2
0
    def POST(self):
        col_handler = self.col_handler('link')
        objs = col_handler.find().sort('id', pymongo.DESCENDING)
        form = linkform()
        if not form.validates():
            return render_to_response('category/manager_link', {
                'form':form,
                'objs':objs,
            })
        link = Link(form['link_addr'].get_value(), 
            form['link_name'].get_value(),
            form['friend_name'].get_value(),
            form['description'].get_value() 
        )
#        print 'aa'
        info = link.save()
        return web.seeother('/manager/link')