示例#1
0
def get_posts():
	if request.method == 'POST':
		# posts = user_manager.get_wall_posts(session['wall_id'])
		# return	render_template('wall_ajax.html', posts = posts, wall_id = session['wall_id'])
		posts = user_manager.get_wall_posts(session['wall_id'],request.form['number'])
		return render_template('wall_ajax.html', posts = posts)
	# if posts.count() == 0:
	#    return ''
	else:
		return render_template('wall_ajax.html')
示例#2
0
def contents(wall_id):
	if wall_id == 0:
		session['username'] = session['email']
		session['wall_id'] = wall_id
		return render_template('contents.html')
	else:		
		
		wall_user = user_manager.get_user(wall_id)
		session['wall_id'] = wall_id
		session['username'] = wall_user.username
		# post_lists = wall_user.wall_posts
		post_lists = user_manager.get_wall_posts(session['wall_id'])
		return render_template('contents.html', post_lists = post_lists)