def create_post(request): if request.method == 'POST': new_content = request.POST.get('content', '') PostModel.create_post(request.user.username, content=new_content) return redirect('posts_list') else: return render(request, 'posts/create.html')
def list_posts(request): posts = PostModel.select_user_latest_with_date(request.user.username) #logger.info("Listed %d posts", len(posts)) return render(request, 'posts/list.html', {'posts': posts})