예제 #1
0
def get_post_feed(current_user_id, location, max_dist=25, page_num=1, post_per_page=10, max_id = None):
	"""
	Get the user's feed. Parameters can be passed for distance filtering and pagination.

	Returns a list of posts
	"""
	offset = page_to_query(page_num, post_per_page)
		
	return post_dao.get_post_feed(current_user_id, location, max_dist, post_per_page, offset, max_id)
예제 #2
0
def get_posts_by_user(current_user_id, searched_user, are_friends, page_num=1, post_per_page=10, max_id=None):
	"""
	Get all the posts with by searched_user. Post visibility is determined by current_user_id and are_friends.
	Parameters can be passed in for pagination.

	Returns a list of the queried post
	"""
	offset = page_to_query(page_num, post_per_page)

	return post_dao.get_posts_by_user(current_user_id, searched_user, are_friends, post_per_page, offset, max_id)