File tree 3 files changed +2
-22
lines changed
3 files changed +2
-22
lines changed Original file line number Diff line number Diff line change 9
9
def home (request ):
10
10
context_instance = RequestContext (request )
11
11
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' )
23
13
elif request .method == 'POST' :
24
14
data = request .POST .urlencode ()
25
15
comment = data .split ('&' )[0 ].split ('=' )[1 ]
@@ -28,17 +18,7 @@ def home(request):
28
18
post_id = '1' ,
29
19
comment = comment )
30
20
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' )
42
22
43
23
@csrf_exempt
44
24
def getComments (request ):
You can’t perform that action at this time.
0 commit comments