def iter_delivs(): deliv_user = User.query.filter_by(username='******').first() deliv_comp = User.query.filter_by(username='******').first() for job in Job.query.filter_by(company_id=deliv_comp.id).all(): yield Delivery(job_id=job.id, user_id=deliv_user.id, company_id=deliv_comp.id)
def iter_delivery(): num = User.query.filter_by(name='company').first().id company_id = Company.query.filter_by(user_id=num).first() yield Delivery( company_id=company_id.id, # 投递的工作需要根据职位和公司id确定 #job_id = Job.query.filter_by(name='工程师',company_id=company_id).first().id, employee_id=Employee.query.filter_by(user_id=User.query.filter_by( name='user').first().id).first().id, qualify='UNREAD')
def apply(job_id): job = Job.query.get_or_404(job_id) if job.current_user_is_applied: flash('已投递过该职位', 'info') else: d = Delivery(job_id=job_id, resume_id=current_user.id) db.session.add(d) db.session.commit() flash('投递成功~', 'success') return redirect(url_for('job.detail', job_id=job.id))
def apply(job_id): if current_user.is_authenticated: if current_user.role != User.ROLE_USER: abort(404) job = Job.query.get_or_404(job_id) # user = User.query.get_or_404(current_user.id) delivery = Delivery() delivery.job_id = job.id delivery.user_id = current_user.id delivery.company_id = job.company_id db.session.add(delivery) # job.users.append(user) db.session.commit() flash('你已成功申请该职位', 'success') return redirect(url_for('job.detail', job_id=job_id)) #return render_template("job/detail.html", job=job) else: form = LoginForm() return render_template("login.html", form=form)
def apply(job_id): job = Job.query.get_or_404(job_id) if job.current_user_is_applied: flash('已经投递过该职位', 'warning') else: d = Delivery(job_id=job.id, user_id=current_user.id) db.session.add(d) db.session.commit() flash('投递成功', 'sucess') return redirect(url_for('job.job_msg', job_id=job.id))
def iter_delivery(): company = Company.query.filter_by(name='腾讯').first() seekers = User.query.filter_by(role=20).limit(5).all() for seeker in seekers: job = randint(0, 19) yield Delivery( resume_id=seeker.resumes[0].id, job_id=company.jobs[job].id, company_id=company.id, status=1, )
def delivery(job_id): job = Job.query.get_or_404(job_id) if job.current_user_is_deliveried: flash('该职位已投递!', 'warning') else: d = Delivery(job_id=job.id, user_id=current_user.id, company_id=job.company_id) db.session.add(d) db.session.commit() flash('投递成功', 'success') return redirect(url_for('job.job_detail', job_id=job.id))
def apply(job_id): job = Job.query.get_or_404(job_id) #从表Job中查找 Job if job.current_user_is_applied: # 判断用户是否投递简历 flash('已投递过该职位','warning') else: d = Delivery( job_id=job.id, user_id=current_user.id ) # 创建Dilvery 表,记录投递简历记录 db.session.add(d) #数据 放入数据库 db.session.commit() flash('投递成功','success') return redirect(url_for('job.detail',job_id=job.id)) #通过job.detail渲染,传入参数
def apply(job_id): job = Job.query.get_or_404(job_id) if job.current_user_is_applied: flash('you have delivered','warning') else: d = Delivery( job_id = job.id, user_id = current_user.id ) db.session.add(d) db.session.commit() flash('successfully delivered','success') return redirect(url_for('job.job_detail',job_id=job.id))
def apply(job_id): job = Job.query.get_or_404(job_id) if current_user.resume_url is None: flash('请上传简历后再投递', 'warnning') elif job.current_user_is_applied: flash('已经投递过该职位', 'warnning') else: d = Delivery(job_id=job.id, user_id=current_user.id, company_id=job.company.id) db.session.add(d) db.session.commit() flash('投递成功', 'success') return redirect(url_for('job.detail', job_id=job.id))
def apply(job_id): job = Job.query.get_or_404(job_id) if job.is_current_user_applied: flash('当前职位已经投递过', 'warning') else: delivery = Delivery(job_id=job_id, user_id=current_user.id, company_id=job.company.id, status=Delivery.STATUS_WAITING, location=job.location) db.session.add(delivery) db.session.commit() flash('投递成功', 'success') return redirect(url_for('.detail', job_id=job_id))
def apply(job_id): user = current_user job = Job.query.get_or_404(job_id) user.collect_jobs.append(job) delivery = Delivery(job_id=job_id, user_id=user.id, company_id=job.company.id, job_name=job.name, user_realname=user.realname, job_address=job.address) db.session.add(delivery) db.session.add(user) db.session.commit() return redirect(url_for('job.job_detail', job_id=job_id))
def apply(job_id): job = Job.query.get_or_404(job_id) resume = Resume.query.filter_by(user_id=current_user.id).first() if resume is None: flash('请上传简历后再投递', 'danger') elif resume: flash('已经投递过该职位', 'danger') else: d = Delivery(resume_id=resume.id, job_id=job.id, company_id=job.company.id, status=1) db.session.add(d) db.session.commit() flash('投递成功', 'success') return render_template('job/detail.html', job=job)
def apply(): job_id = request.args.get("job_id", "") job = Job.query.get_or_404(job_id) applied = False if not current_user.resume_url: flash("请上传简历后再投递", "warnning") elif Delivery.query.filter(Delivery.job_id == job.id, Delivery.user_id == current_user.id).first(): applied = True flash("已经投递过该职位", "warnning") else: d = Delivery(job_id=job.id, user_id=current_user.id, company_id=job.company.id) db.session.add(d) db.session.commit() flash("投递成功", "success") return redirect(url_for("job.detail", job_id=job.id, applied=applied))
def resume(job_id): user = current_user job = Job.query.get_or_404(job_id) if user.is_user: delivery = Delivery.query.get(job_id) if delivery: flash('您已经投递过该职位了', 'success') return redirect(url_for('job.detail', job_id=job_id)) else: delivery = Delivery(job_id=job_id, user_id=user.id, company_id=job.companies.id) db.session.add(delivery) db.session.commit() flash('简历投递成功', 'success') return redirect(url_for('job.detail', job_id=job_id)) else: flash('个人用户才能投递简历', 'success') return redirect(url_for('job.detail', job_id=job_id))
def apply(job_id): job = Job.query.get_or_404(job_id) form = SeekerResumeForm() resume = Resume.query.filter_by(user_id=current_user.id).first() if resume is None: flash('请上传简历后再投递', 'danger') elif resume: flash('已经投递过该职位', 'danger') else: if form.validate_on_submit(): # TODO 投简历form form.update_resume() d = Delivery(resume_id=resume.id, job_id=job.id, company_id=job.company.id, status=1) db.session.add(d) db.session.commit() flash('投递成功', 'success') return render_template('job/detail.html', job=job)
def delivery(): return Delivery( id = 1, job_id = 1, user_id = 2, company_id = 1)