Ejemplo n.º 1
0
def create_project():
    form = StartProjectForm()

    if form.validate_on_submit():

        if Project.find_by_title(form.title.data, current_user.user_id) == None:
            project = Project(title = form.title.data,
                description = form.description.data, user_id = current_user.user_id)
            project.save_to_db()
            return redirect(url_for("projects.overview", title=project.title))
    return render_template("projects/create.html", form=form, action="create")
Ejemplo n.º 2
0
 def create_project(self, title, description, user_id):
     project = Project(title=title,
                       description=description,
                       user_id=user_id)
     project.save_to_db()