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)
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)
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)