summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgnowgi <nagarjun@gnowledge.org>2012-09-04 19:18:43 -0700
committergnowgi <nagarjun@gnowledge.org>2012-09-04 19:18:43 -0700
commitcad11e2f7ed848cdfd7779451bb0f4f931e062c3 (patch)
tree49c85045d5bbf5489ffed493d75f060c31de7f5a
parent85f7d716309b79fb1f46dc887897a127017841cb (diff)
parent975e4380ea41eb151f5488da436e28c7b1d1082a (diff)
downloadgnowsys-cad11e2f7ed848cdfd7779451bb0f4f931e062c3.tar.gz
Merge pull request #84 from kabirkukreti/master
Unicode error solved and unicode support added
-rw-r--r--gstudio/methods.py4
-rw-r--r--gstudio/views/pageadd.py4
-rw-r--r--gstudio/views/sectionadd1.py4
-rw-r--r--gstudio/views/topicadd.py4
4 files changed, 9 insertions, 7 deletions
diff --git a/gstudio/methods.py b/gstudio/methods.py
index ad4bcee..bdcc5ad 100644
--- a/gstudio/methods.py
+++ b/gstudio/methods.py
@@ -202,7 +202,9 @@ def create_wikipage(title,idusr,content_org):
sys = System()
sys.title = title
sys.status = 2
- sys.content_org= content_org
+ contorg = unicode(content_org)
+ sys.content_org = contorg.encode('utf8')
+
myfile = open('/tmp/file.org', 'w')
myfile.write(sys.content_org)
myfile.close()
diff --git a/gstudio/views/pageadd.py b/gstudio/views/pageadd.py
index 4f63ead..d51017c 100644
--- a/gstudio/views/pageadd.py
+++ b/gstudio/views/pageadd.py
@@ -29,9 +29,9 @@ def pageadd(request):
# if not request.POST.get('org1', ''):
# errors.append('Enter a page.')
if not errors:
- title=request.POST['subject']
+ title=unicode(request.POST['subject'])
# content=request.POST['page']
- content_org=request.POST['org1']
+ content_org=unicode(request.POST['org1'])
idusr=request.POST['idusr']
pageId = create_wikipage(title,int(idusr),content_org)
if pageId :
diff --git a/gstudio/views/sectionadd1.py b/gstudio/views/sectionadd1.py
index 0c5643c..8bc3dd1 100644
--- a/gstudio/views/sectionadd1.py
+++ b/gstudio/views/sectionadd1.py
@@ -19,9 +19,9 @@ def sectionadd1(request,pageid):
if not request.POST.get('org', ''):
errors.append('Enter a page.')
if not errors:
- title=request.POST['subject']
+ title=unicode(request.POST['subject'])
# content=request.POST['page']
- content_org=request.POST['org']
+ content_org=unicode(request.POST['org'])
idusr=request.POST['idusr']
tp = make_section_object(title,int(idusr),content_org)
System.objects.get(id=int(pageid)).system_set.all()[0].gbobject_set.add(tp)
diff --git a/gstudio/views/topicadd.py b/gstudio/views/topicadd.py
index ba094c5..31e780e 100644
--- a/gstudio/views/topicadd.py
+++ b/gstudio/views/topicadd.py
@@ -32,8 +32,8 @@ def topicadd(request):
if not request.POST.get('message', ''):
errors.append('Enter a message.')
if not errors:
- title=request.POST['subject']
- content=request.POST['message']
+ title=unicode(request.POST['subject'])
+ content=unicode(request.POST['message'])
idusr=request.POST['idusr']
boolean = make_topic_object(title,int(idusr),content)
if boolean :