def post(self): args = self.request.arguments pagenum = int(args.get("page_num")[0]) show = ShowService() data_list, final_tag, num = show.initPicTree(pagenum) print args im_path = args.get("image_path")[0].split("pictures/")[1].split("?")[0] print im_path img_path = os.path.normpath(im_path) new_tage_names = args.get("new_tag_names") or [] tags = args.get("tag") or [] print img_path print new_tage_names print tags service = TagService() for each in new_tage_names: service.addTag(each) for each in tags: service.addTag2Pic(int(each), img_path) self.render("tagging.html", table_list=data_list, pagenum=num, final_tag=final_tag, allTagList=show.allTags()) pass
def post(self): service = SegmentService() args = self.request.arguments pagenum = int(args.get("pagenum") and int(args.get("pagenum")[0]) or 1) show = ShowService() data_list,final_tag,num = show.initPicTree(pagenum) service.cut(self.request.arguments) self.render("segment.html",table_list=data_list,pagenum=num,final_tag=final_tag)
def get(self, *args, **kwargs): args = self.request.arguments #确保有有pagenum参数,如果没有,设为0,首页 if "pagenum" in args.keys(): num = int(args.get("pagenum")[0]) else: num = 1 show = ShowService() data_list,final_tag,num = show.initPicTree(num) self.render("segment.html",table_list=data_list,pagenum=num,final_tag=final_tag,allTagList=show.allTags())
def get(self, *args, **kwargs): show = ShowService() list = show.allTags() name = [item[0].encode('utf-8') for item in list] print name self.render("manage.html",names =json.dumps(name))