mary wrote:
>i wrote this view
>def index(request):
> output=open( '/var/www/xml-python/xmleditor/test.xml','w')
> output.write('<?xml version="1.0" encoding="iso-8859-1"?>')
> output.write('<content_topnav>')
> latest_menu_list = Menu.objects.all().order_by('-id')
> output = ', '.join([m.menu_text for m in latest_menu_list])
> output.write(output)
>
>
>
> return HttpResponse(output)
>
>
After fixing what others have pointed you will probably have a next
problem with empty output in a browser. You're passing your "output"
object to HttpResponse while output's position is at its end. You should
move to the beginning:
output.seek(0)
return HttpResponse(output)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---