Thank you Patrick and Gábor,
Here is my final view (tested with Django HTTP server, FireFox 2.0 and
IE6.0):
from django.shortcuts import HttpResponse
from wabe.body.models import Section
from django.utils.simplejson import dumps
def loadcontent(request):
post = request.POST.copy()
section = Section.objects.get(pk=post['section'])
contents = []
for co in section.contentsorder_set.all().iterator():
contents.append({'content': co.datacontent.content,
'type': co.datacontent.type})
json = dumps(contents, ensure_ascii=False)
return HttpResponse(json, mimetype="text/json;
charset=UTF-8")
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---