def create(comment, name=None, email=None): name = name if name != '' else None email = email if email != '' else None feedback = Feedback(comment=comment, name=name, email=email) feedback.put() feedback.id = feedback.key().id() feedback.put() return feedback
def feedback_submitted(): user_id = current_user.id fb = request.values['feedback'] new_feedback = Feedback(user_id=user_id, feedback=fb) db.session.add(new_feedback) db.session.commit() return render_template("booking/feedbacksubmitted.html")
def provide_feedback(user_id, group_name, feedback_text): """Provide Feedback For A Project On The Meeting Page; User_ID is the person providing feedback (the reviewer), not the one receiving it.""" group_id = get_group_id_by_name(group_name) project = get_project_by_group_id(group_id) submission = db.session.query(Submission).filter( Submission.project_id == project.project_id, Submission.text != None).order_by( Submission.submission_id.desc()).first() if submission: feedback = Feedback(user_id=user_id, submission_id=submission.submission_id, text=feedback_text) db.session.add(feedback) db.session.commit() else: return "Sorry, we couldn't find that project."
def feedback_page(username): form = feedbackForm() user = User.query.filter_by(username=username).first() if session['user_id'] != user.username: flash("you must be logged in to create a feedback!", category='primary') return redirect('/login') if form.validate_on_submit(): title = form.title.data content = form.content.data username = username new_fb = Feedback(title=title, content=content, username=username) db.session.add(new_fb) db.session.commit() flash("Created a new feedback!", category='primary') return redirect(f'/user/{username}') else: return render_template('feedback.html', form=form)
def add_feed(playlist, feedback): feed_object = Feedback(playlist=playlist, feedback=feedback) session.add(feed_object) session.commit()
def fetch(id): return Feedback.gql('WHERE id = :1', id).get()
def latest(n): return Feedback.all().fetch(n)