Skip to content

Commit 369640a

Browse files
committed
updated
2 parents abb292f + 1b9e301 commit 369640a

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

comments.json

Whitespace-only changes.

django_comments/comments.json

Whitespace-only changes.

django_comments/django_comments/views.py

+2-22
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,7 @@
99
def home(request):
1010
context_instance=RequestContext(request)
1111
if request.method == 'GET':
12-
data = Comments.objects.all()
13-
comments = []
14-
for obj in data:
15-
commentCurr = {
16-
"author": obj.user_id,
17-
"text": obj.comment,
18-
"post_id": obj.post_id,
19-
}
20-
comments.append(commentCurr)
21-
comments.append({ 'status_code' : 'success' })
22-
return render_to_response('index.html', comments)
12+
return render_to_response('index.html')
2313
elif request.method == 'POST':
2414
data = request.POST.urlencode()
2515
comment = data.split('&')[0].split('=')[1]
@@ -28,17 +18,7 @@ def home(request):
2818
post_id = '1',
2919
comment = comment)
3020
p1.save()
31-
data = Comments.objects.all()
32-
comments = []
33-
for obj in data:
34-
commentCurr = {
35-
"author": obj.user_id,
36-
"text": obj.comment,
37-
"post_id": obj.post_id,
38-
}
39-
comments.append(commentCurr)
40-
comments.append({ 'status_code' : 'success' })
41-
return render_to_response('index.html', comments)
21+
return render_to_response('index.html')
4222

4323
@csrf_exempt
4424
def getComments(request):

0 commit comments

Comments
 (0)