Skip to content

Commit 2e58852

Browse files
committed
reverting back.
1 parent c4476d1 commit 2e58852

32 files changed

+100
-14
lines changed

LICENSE

100644100755
File mode changed.

MANIFEST.in

100644100755
File mode changed.

README.md

100644100755
-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Django Comments Module
22

3-
v0.0.4
43
To run:
54

65
```

comments.json

100644100755
File mode changed.

django_comments/LICENSE

100644100755
File mode changed.

django_comments/MANIFEST.in

100644100755
File mode changed.

django_comments/README.md

100644100755
File mode changed.

django_comments/comment_react/__init__.py

Whitespace-only changes.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import models, migrations
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
]
11+
12+
operations = [
13+
migrations.CreateModel(
14+
name='Comments',
15+
fields=[
16+
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
17+
('user_id', models.CharField(max_length=250)),
18+
('post_id', models.CharField(max_length=250)),
19+
('comment', models.CharField(max_length=500)),
20+
],
21+
),
22+
]

django_comments/comment_react/migrations/__init__.py

Whitespace-only changes.
File renamed without changes.
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.test import TestCase
2+
3+
# Create your tests here.

django_comments/comment_react/urls.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.conf.urls import include, url
2+
from django.contrib import admin
3+
4+
urlpatterns = [
5+
url(r'^admin/', include(admin.site.urls)),
6+
url(r'^$', views.home, name="home"),
7+
]
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from django.shortcuts import render, render_to_response
2+
3+
def home(request):
4+
return render_to_response('demo.html')

django_comments/comments.json

Whitespace-only changes.

django_comments/comments.json~

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"text": "sdfn", "author": "Author"}{"text": "dkhkdg", "author": "Author"}{"text": "dgbmsdgb", "author": "Author"}{"text": "fdgjd", "author": "Author"}{"text": "fd%2Cn%2C", "author": "Author"}{"text": "dshkh", "author": "Author"}{"text": "dfb", "author": "Author"}{"text": "fdn", "author": "Author"}{"text": "fdn", "author": "Author"}{"text": "dsfaf", "author": "Author"}

django_comments/django_comments/__init__.py

Whitespace-only changes.
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
import os
3+
import sys
4+
5+
if __name__ == "__main__":
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "comments_demo.settings")
7+
8+
from django.core.management import execute_from_command_line
9+
10+
execute_from_command_line(sys.argv)
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from django.db import models
2+
3+
class Save_comments(models.Model):
4+
user_id = models.CharField(max_length=250)
5+
post_id = models.CharField(max_length=250)
6+
comment = models.CharField(max_length=500)
7+
8+
def __str__(self):
9+
return self.user_id+self.comment
10+
11+
def save(self, *args, **kwargs):
12+
super(Save_comments, self).save(*args, **kwargs)
File renamed without changes.
File renamed without changes.

django_comments/views.py django_comments/django_comments/views.py

+5-9
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def home(request):
1313
comments = []
1414
for obj in data:
1515
commentCurr = {
16-
"user_id": obj.user_id,
17-
"comment": obj.comment,
16+
"author": obj.user_id,
17+
"text": obj.comment,
1818
"post_id": obj.post_id,
1919
}
2020
comments.append(commentCurr)
@@ -24,8 +24,6 @@ def home(request):
2424
data = request.POST.urlencode()
2525
comment = data.split('&')[0].split('=')[1]
2626
author = data.split('&')[1].split('=')[1]
27-
print 'comment - '+ comment
28-
print 'author - '+ author
2927
p1 = Comments(user_id=author,
3028
post_id = '1',
3129
comment = comment)
@@ -34,8 +32,8 @@ def home(request):
3432
comments = []
3533
for obj in data:
3634
commentCurr = {
37-
"user_id": obj.user_id,
38-
"comment": obj.comment,
35+
"author": obj.user_id,
36+
"text": obj.comment,
3937
"post_id": obj.post_id,
4038
}
4139
comments.append(commentCurr)
@@ -47,11 +45,9 @@ def getComments(request):
4745
data = Comments.objects.all()
4846
comments = []
4947
for obj in data:
50-
obj_comment = obj.comment
51-
obj_comment_refined = obj_comment.replace ("+", " ");
5248
commentCurr = {
5349
"author": obj.user_id,
54-
"text": obj_comment_refined,
50+
"text": obj.comment.replace('+',' '),
5551
"post_id": obj.post_id,
5652
}
5753
comments.append(commentCurr)
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for django_comments project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_comments.settings")
15+
16+
application = get_wsgi_application()

django_comments/requirements.txt

100644100755
File mode changed.

django_comments/setup.cfg

100644100755
File mode changed.

django_comments/setup.py

100644100755
File mode changed.

django_comments/static/css/style.css

100644100755
File mode changed.

django_comments/templates/index.html

100644100755
+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
/** @jsx React.DOM */
77
var CommentBox = React.createClass({
88
getInitialState: function() {
9+
// $.ajax({
10+
// url : "getcomments/",
11+
// type : "POST",
12+
// success : function(data) {
13+
// console.log('success - '+ JSON.stringify(data));
14+
// return data;
15+
// },
16+
// error : function(xhr,errmsg,err) {
17+
// console.log('err');
18+
// console.log(xhr.status + ": " + xhr.responseText);
19+
// return {data: []};
20+
// }
21+
// });
922
return {data: []};
1023
},
1124
loadCommentsFromServer: function() {

requirements.txt

100644100755
File mode changed.

setup.cfg

100644100755
File mode changed.

setup.py

100644100755
+4-4
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
setup(
1313
name='django-react-comments',
1414

15-
version='0.0.4',
15+
version='0.0.3',
1616

1717
description='Django comment module using in reactJS',
1818
long_description='Django comment module using in reactJS. Currently only stores to db and uses a dummy user and post.',
1919

2020
url='https://github.com/djangothon/django-react-comments',
2121

22-
authors='Kumar Anirudha,Puja Singh',
23-
22+
authors='Kumar Anirudha','Puja Singh',
23+
2424

2525
license='MIT',
2626

2727
classifiers=[
2828
'Framework :: Django',
29-
'Development Status :: 4 - Alpha',
29+
'Development Status :: 3 - Alpha',
3030
'Intended Audience :: Developers',
3131
'Operating System :: OS Independent',
3232
'Programming Language :: Python :: 2',

0 commit comments

Comments
 (0)