Exemple #1
0
def load_more_posts():
	if session.get('logged_in') is None:
		return redirect(url_for('PetCare.login'))
	accountDao = AccountDao()
	reputation = accountDao.get_account_reputation(session['logged_in'].rstrip())
	postDao = PostDao()
	posts = postDao.list_limited_posts(reputation=reputation, limit=4, offset=request.args.get('offset'))
	postInfos = [Entities.make_post_output(dict(post)) for post in posts]
	return jsonify(postInfos)
Exemple #2
0
def list_posts():
	if session.get('logged_in') is None:
		return redirect(url_for('PetCare.login'))
	accountDao = AccountDao()
	reputation = accountDao.get_account_reputation(session['logged_in'].rstrip())		
	postDao = PostDao()
	posts = postDao.list_limited_posts(reputation=reputation, limit=4, offset=0)
	postInfos = [Entities.make_post_output(dict(post)) for post in posts]
	return render_template('list_posts.html', posts=postInfos, fromFilter=False)