def adduser(): form = RegisterForm() if form.validate_on_submit(): form.create_user() #默认创建普通求职者用户 flash('求职者用户创建成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_user.html', form=form)
def jobseeker_register(): form = RegisterForm() if form.validate_on_submit(): form.create_user(10) flash('Jobseeket register success', 'success') return redirect(url_for('.login')) return render_template("reg_jobseeker.html", form=form)
def companyregister(): form = RegisterForm() if form.validate_on_submit(): form.create_user() flash('Register success,please login!', 'success') return redirect(url_for('.login')) return render_template('companyregister.html', form=form)
def company_register(): form = RegisterForm() if form.validate_on_submit(): form.create_user(True) #企业用户创建时需要为role送入ROLE_COMPANY flash('企业用户注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('company_register.html', form=form)
def company_register(): form = RegisterForm() if form.validate_on_submit(): form.create_user(20) flash('Company register success', 'success') return redirect(url_for('.login')) return render_template("reg_company.html", form=form)
def register_company(): form = RegisterForm() if form.validate_on_submit(): form.create_user(20) flash('注册成功', 'success') return redirect(url_for('front.login')) return render_template('register_company.html', form=form)
def create_user(): form = RegisterForm() if form.validate_on_submit(): form.create_user() flash('创建用户成功', 'success') return redirect(url_for('admin.user')) return render_template('admin/create_user.html', form=form)
def personalregister(): form = RegisterForm() if form.validate_on_submit(): form.create_user() # create_user()函数包含session.add() flash('用户注册成功,请登录', 'success') # 增加flash展示 return redirect(url_for('front.login')) return render_template('personalregister.html', form=form)
def register(): form = RegisterForm() if form.validate_on_submit(): form.create_user() flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('register.html', form=form)
def userregister(): form = RegisterForm() if form.validate_on_submit(): form.create_user() flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('userregister.html', form=form)
def create_user(): form = RegisterForm() if form.is_submitted(): form.create_user() flash('求职者创建成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_user.html', form=form)
def addcompany(): form = RegisterForm() if form.validate_on_submit(): form.create_user(True) #企业用户创建时需要为role送入ROLE_COMPANY flash('企业用户创建成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_company.html', form=form)
def create_user(): form = RegisterForm() if form.is_submitted(): form.create_user() flash('求职者创建成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_user.html', form=form)
def company_register(): form = RegisterForm() form.username.label.text = '企业名' if form.validate_on_submit(): form.create_user(20) flash('企业注册成功,请完善信息!', 'success') return render_template('login.html') return render_template('company_register.html', form=form)
def user_register(): form = RegisterForm() if form.validate_on_submit(): form.create_user(30) flash('用户注册成功,请完善信息!', 'success') return render_template('login.html') return render_template('user_register.html', form=form)
def company_register(): form = RegisterForm() form.username.label = u'企业名称' if form.validate_on_submit(): form.create_user(User(role=User.ROLE_COMPANY)) flash('企业注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('company_register.html', form=form)
def create_company(): form = RegisterForm() form.name.label = u'企业名称' if form.validate_on_submit(): form.create_user() flash('企业创建成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_company.html', form=form)
def create_company(): form = RegisterForm() form.name.label = u'企业名称' if form.validate_on_submit(): form.create_user() flash('企业创建成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_company.html', form=form)
def register_company(): form = RegisterForm() if form.validate_on_submit(): user = User() form.populate_obj(user) user.role = 20 form.create_user(user) flash('注册成功', 'success') return redirect(url_for('user.index')) return render_template('register_company.html', form=form)
def userregister(): form = RegisterForm() if form.validate_on_submit(): if not form.username.data.isalnum(): flash('用户名只支持数字和字母', 'danger') else: form.create_user() flash('注册成功,请登录', 'success') return redirect(url_for('front.login')) return render_template('userregister.html', form=form)
def userregister(): """ 用户注册 """ form = RegisterForm() post_url = url_for("front.userregister") if form.validate_on_submit(): form.create_user() flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('register.html', form=form, post_url=post_url, topic="用户注册")
def create_user(): """ 创建普通用户 """ form = RegisterForm() post_url = url_for("admin.create_user") if form.validate_on_submit(): form.create_user() flash("用户创建成功!", "success") return redirect(url_for("admin.manage_user")) return render_template("admin/create_user.html", form=form, post_url=post_url, topic="用户创建")
def companyregister(): form = RegisterForm() if form.validate_on_submit(): company = form.create_user() company.role = User.ROLE_COMPANY # 设置成公司用户 db.session.add(company) # 提交到Company表 db.session.commit() return redirect(url_for('front.login')) return render_template('companyregister.html', form=form)
def companyregister(): form = RegisterForm() if form.validate_on_submit(): company_user = form.create_user() company_user.role = User.ROLE_COMPANY db.session.add(company_user) db.session.commit() flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('front/companyregister.html', form=form)
def companyregister(): form = RegisterForm() form.name.label = 'CompanyName' if form.validate_on_submit(): company_user = form.create_user() company_user.role = User.ROLE_COMPANY db.session.add(company_user) db.session.commit() flash('register success', 'sucess') return redirect(url_for('.login')) return render_template('companyregister.html', form=form)
def companyregister(): form = RegisterForm() form.name.label = u'企业名称' if form.validate_on_submit(): user = form.create_user() user.role = User.ROLE_COMPANY db.session.add(user) db.session.commit() flash('公司注册成功,请登录。', 'success') return redirect(url_for('.login')) return render_template('companyregister.html', form=form)
def companyregister(): form = RegisterForm() form.name.label = u'企业名称' if form.validate_on_submit(): company = form.create_user() company.role = User.ROLE_COMPANY # 设置成公司用户 db.session.add(company) # 提交到Company表 db.session.commit() flash('用户注册成功,请登录', 'success') # 增加flash展示 return redirect(url_for('front.login')) return render_template('companyregister.html', form=form)
def create_company(): form = RegisterForm() form.username.label = u'企业名称' if form.validate_on_submit(): company_user = form.create_user() company_user.role = User.ROLE_Company db.session.add(company_user) db.session.commit() flash('企业创建成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_company.html', form=form)
def create_company(): form = RegisterForm() form.name.label.text = '公司名称' if form.validate_on_submit(): user = form.create_user() user.role = User.ROLE_COMPANY db.session.add(user) db.session.commit() flash('创建公司成功', 'success') return redirect(url_for('admin.users')) return render_template('admin/create_company.html', form=form)
def companyregister(): form = RegisterForm() form.name.label = u'企业名称' if form.validate_on_submit(): company_user = form.create_user() company_user.role = User.ROLE_COMPANY db.session.add(company_user) db.session.commit() flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('companyregister.html', form=form)
def Comregister(): form = RegisterForm() form.username.label = u'企业名称' if form.validate_on_submit(): company_user = form.create_user() company_user.role = User.ROLE_Company db.session.add(company_user) db.session.commit() flash('注册成功,清登录', 'success') return redirect(url_for('.login')) return render_template('comregister.html', form=form)
def company_register(): form = RegisterForm() #form.username.label = '公司名称' if form.validate_on_submit(): role_user = form.create_user() role_user.role = 20 db.session.add(role_user) try: db.session.commit() except: db.session.rollback() flash('注册成功,请登陆','success') return redirect(url_for('.login')) return render_template('register_company.html',form=form)
def companyregister(): form = RegisterForm() #引用flask-WTF,基类FlaskForm生成的对象。实现,pychon创建html的form。 form.name.label = '企业名称' #改变form.name.label 属性值(个人名称为企业名称) if form.validate_on_submit(): # validate_on_submit来自于,flask-WTF,提供的FlaskForm的方法中。 company_user = form.create_user() #将form从用户得到的数据,传给数据库。返回一个User对象。 company_user.role = User.COMPANY #改变User对象role db.session.add(company_user) #更新数据 db.session.commit() flash('注册成功,请登录','success') return redirect(url_for('.login')) #跳转到login 登录页面 return render_template('companyregister.html',form=form)
def companyregister(): form = RegisterForm() form.name.label.text = '企业名称' if form.validate_on_submit(): user = form.create_user() user.role = User.ROLE_COMPANY db.session.add(user) company = Company(name=user.name, short_name=user.name, user_id=user.id) db.session.add(company) db.session.commit() flash('注册成功,请登录!', 'success') return redirect(url_for('.login')) return render_template('companyregister.html', form=form)