def post(self, po_id): add = self.get_argument('add_spammer', None) del_all = self.get_argument('del_all', None) p = Po.mc_get(po_id) if p: user = p.user if user: user_id = user.id if add: spammer_new(user_id) if del_all: spammer_reset(user_id) po_rm(user_id, po_id) self.redirect('/po')
def post(self, po_id): add = self.get_argument("add_spammer", None) del_all = self.get_argument("del_all", None) p = Po.mc_get(po_id) if p: user = p.user if user: user_id = user.id if add: spammer_new(user_id) if del_all: spammer_reset(user_id) po_rm(user_id, po_id) self.redirect("/po")
def get(self, id): spammer_new(id) self.redirect('/zsite/%s' % id)
def main(): for i in ormiter(Spammer): print "spaming",i.id spammer_new(i.id)