Example #1
0
def homepage():
    """renders homepage information"""
	
    share = db.session.query(Post, User).join(User).filter(db.and_(
    	Post.post_types == "Share", Post.active == True)).all()
    wish = db.session.query(Post, User).join(User).filter(db.and_(
    	Post.post_types == "Wish", Post.active == True)).all()

    return render_template("homepage.html", share=share, wish=wish)
Example #2
0
def user_page():
    """displays relevent user information"""

    current_user = session.get("user_id")
    user = User.query.filter(User.user_id == current_user).first()

    share = Post.query.filter(db.and_(Post.user_email == user.email,
    	Post.active == True, Post.post_types == "Share")).all()
    wish = Post.query.filter(db.and_(Post.user_email == user.email,
    	Post.active == True, Post.post_types == "Wish")).all()


    return render_template('user_page.html', user=user, 
    	share=share, wish=wish)
Example #3
0
def delete_posting():
	"""renders the template for deativating postings"""

	current_user = session.get("user_id")
	user = User.query.filter(User.user_id == current_user).first()
	post = Post.query.filter(db.and_(Post.user_email == user.email,
		Post.active == True)).all()

	return render_template('delete_posting.html', post=post)
Example #4
0
def select_post_update():
	"""renders post selection form"""

	current_user = session.get("user_id")
	user = User.query.filter(User.user_id == current_user).first()
	post = Post.query.filter(db.and_(Post.user_email == user.email,
		Post.active == True)).all()
	

	return render_template('select_post.html', post=post)