Exemplo n.º 1
0
def addjob():
    form = AddJobForm()
    if form.validate_on_submit():
        form.addjob()
        flash('职位添加成功', 'success')
        return redirect(url_for('.index'))

    return render_template('job/createjob.html', form=form)
Exemplo n.º 2
0
def addjob(cid):
    company = Company.query.get_or_404(cid)
    form = AddJobForm()
    if form.validate_on_submit():
        form.addjob(company)
        flash('职位添加成功', 'success')
        return redirect(url_for('company.admin'))
    return render_template('job/createjob.html', form=form, cid=cid)
Exemplo n.º 3
0
def addjob(user_id):
    user = User.query.get(user_id)
    company = user.company
    form = AddJobForm()
    if form.validate_on_submit():
        form.addjob(company=company)
        flash('职位添加成功', 'success')
        return redirect(url_for('admin.jobs'))
    return render_template('job/createjob.html', form=form, user_id=user_id)