Permalink
Browse files

Unicode error solved and unicode support added

  • Loading branch information...
1 parent 85f7d71 commit 975e4380ea41eb151f5488da436e28c7b1d1082a Kabir Kukreti committed Sep 4, 2012
Showing with 9 additions and 7 deletions.
  1. +3 −1 gstudio/methods.py
  2. +2 −2 gstudio/views/pageadd.py
  3. +2 −2 gstudio/views/sectionadd1.py
  4. +2 −2 gstudio/views/topicadd.py
View
@@ -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()
View
@@ -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 :
@@ -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)
@@ -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 :

0 comments on commit 975e438

Please sign in to comment.