def __init__(self, **kwargs): self.children = [] self.attrs = [] self.tag = getparam(kwargs, 'tag', None, True) self.single_line = getparam(kwargs, 'single_line', False, True) self.close_tag = getparam(kwargs, 'close_tag', True, True) for key, value in kwargs.items(): self.attr(HtmlAttribute(key, value))
def addcatagory(): catagory=Catagory() requeststr = request.query_string print unquote(requeststr) params=utils.getparam(unquote(requeststr)) catagory.catagoryname=params['catagoryname'] catagory.belongto=params['belongto'] catagory.addcatagory() return jsonify(msg='0000')
def editcatagory(): catagory=Catagory() requeststr=request.query_string params=utils.getparam(unquote(requeststr)) paramdict={} paramdict["catagoryid"]=params['catagoryid'] paramdict["catagoryname"]=params['catagoryname'] paramdict["belongto"]=params['belongto'] catagory.updatecatagory(paramdict) return jsonify(msg='0000')
def adduser(): user=User() requeststr = request.query_string params=utils.getparam(unquote(requeststr)) user.username=params['username'] user.email=params['email'] user.password=params['password'] user.sex=params['sex'] user.adduser() return jsonify(msg='0000')
def edituser(): user=User() requeststr=request.query_string params=utils.getparam(unquote(requeststr)) paramdict={} paramdict["userid"]=params['userid'] paramdict["username"]=params['username'] paramdict["email"]=params['email'] paramdict["password"]=params['password'] paramdict["sex"]=params['sex'] user.updateuser(paramdict) return jsonify(msg='0000')
def login(): requeststr = request.query_string params=utils.getparam(requeststr) username=params['username'] return render_template("index.html",title = 'Home',action='/login')
def __init__(self, **kwargs): styles = getparam(kwargs, 'styles', None, True) super().__init__(tag='style', **kwargs) if styles is not None: for line in styles: self.child(line)