def POST(self): file=web.input(pic={}) cwd=os.getcwd() dir="static\uploads\\"+(session_data["user"]["Email"]).split("@")[0] file_dir=os.path.join(cwd,dir) if os.path.exists(file_dir): for f in os.listdir(file_dir): os.remove(file_dir+"\\"+f) if not os.path.exists(file_dir): os.makedirs(file_dir) if "pic" in file: filepath=file["pic"].filename f=open(file_dir+"\\"+filepath,"wb") f.write(file['pic'].file.read()) f.close() model=Register.RegisterModel() data={} data["email"]=session_data["user"]["Email"] data["imagepath"]=dir+"\\"+filepath model.upload_pic(data) data={} data["message"]="Profile Updated Successfully" return render.Setting(data)
def POST(self): data=web.input() data.email=session_data['user']['Email'] u_model=Register.RegisterModel() u_model.update_user(data) return "pass"
def POST(self): data=web.input() reg_model=Register.RegisterModel() reg_model.insert_user(data) return "pass"
def POST(self): data=web.input() model=Register.RegisterModel() user= model.getProfile(data.id) return render.Profile(user)
def GET(self): model=Register.RegisterModel() data=model.getUser() return render.Discover(data)