def upload_resume(key_id): job = Job.retrieve_by_id(key_id) if not job or not job.is_public: return redirect(url_for('about.jobs')) form = ResumeForm() if request.method == 'POST' and form.validate_on_submit(): resume = Resume() form.populate_obj(resume) resume.vacancy = job.key upload_files = get_uploads(request, 'attach_file_') if len(upload_files): blob_info = upload_files[0] if blob_info.size: file_ = File.create( blob_info.key(), size=blob_info.size, filename=os.path.basename(blob_info.filename.replace('\\','/')), content_type=blob_info.content_type) file_.put() resume.attach_file = file_.key else: blob_info.delete() resume.put() return render_template('about/resume_thanks.html', html_class='about_class') upload_url = blobstore.create_upload_url(url_for('about.upload_resume', key_id=key_id)) return render_template( 'about/job.html', html_class='about_page', job=job, form=form, upload_url=upload_url, is_send_form=True )
def resume(key_id): job = Job.retrieve_by_id(key_id) if not job: return redirect(url_for('about.admins.jobs.index')) resumes = Resume.query(Resume.vacancy == job.key) return render_template( 'about/admins/jobs/resume.html', job=job, resumes=resumes )