Beispiel #1
0
def add_jobs(db_sess):
    jobs = Jobs()
    jobs.team_leader = 2
    jobs.job = "search for water"
    jobs.work_size = "20"
    jobs.collaborators = 5, 7
    jobs.is_finished = False
Beispiel #2
0
def add_news():
    form = JobsForm()
    if form.validate_on_submit():
        db_sess = db_session.create_session()
        jobs = Jobs()
        jobs.job = form.job.data
        jobs.team_leader = form.team_leader.data
        jobs.duration = form.duration.data
        jobs.collaborators = form.collaborators.data
        jobs.is_finished = form.is_finished.data
        current_user.jobs.append(jobs)
        db_sess.merge(current_user)
        db_sess.commit()
        return redirect('/')
    return render_template('jobs.html', title='add work', form=form)