def comment(request): # user は STIPUser stip_user = request.user if request.method == 'POST': # 引数取得 package_id = request.POST['package_id'] # コメント投稿 post_comment(stip_user, package_id, request.POST['post'], stip_user) # 表示用 comments = rs.get_comment_from_rs(stip_user, package_id) feeds = [] for comment in comments: feeds.append( Feed.get_feeds_from_package_from_rs(stip_user, comment)) return render(request, 'feeds/partial_feed_comments.html', {'feeds': feeds}) else: # 引数取得 package_id = request.GET['package_id'] comments = rs.get_comment_from_rs(stip_user, package_id) feeds = [] for comment in comments: feeds.append( Feed.get_feeds_from_package_from_rs(stip_user, comment)) return render(request, 'feeds/partial_feed_comments.html', {'feeds': feeds})
def track_comments(request): # 引数取得 stip_user = request.user package_id = request.GET['package_id'] comments = rs.get_comment_from_rs(stip_user, package_id) feeds = [] for comment in comments: feeds.append(Feed.get_feeds_from_package_from_rs(stip_user, comment)) return render(request, 'feeds/partial_feed_comments.html', {'feeds': feeds})