Exemple #1
0
def updatejob(jobid):
    job = Job.query.get_or_404(jobid)
    form = AddJobForm(obj=job)
    if form.validate_on_submit():
        form.updatejob(job)
        flash('{} 职位下线成功'.format(job.name), 'success')
        return redirect(url_for('admin.jobs'))
    return render_template('job/updatejob.html', form=form, job=job)
Exemple #2
0
def updatejob(jobid):
    job = Job.query.get_or_404(jobid)
    form = AddJobForm(obj=job)  # 用表对象填充表单模型对象
    if form.validate_on_submit():
        form.updatejob(job)
        flash('职位更新成功', 'success')
        return redirect(url_for('.index'))
    return render_template('job/updatejob.html', form=form, job=job)
Exemple #3
0
def updatejob(cid, jobid):
    company = Company.query.get_or_404(cid)
    job = Job.query.get_or_404(jobid)

    form = AddJobForm(obj=job)  # 用表对象填充表单模型对象
    if form.validate_on_submit():
        form.updatejob(company, job)
        flash('职位更新成功', 'success')
        return redirect(url_for('company.admin'))

    return render_template('job/updatejob.html', form=form, cid=cid, job=job)