views:

39

answers:

1

Hi, i have this function in a view that shows the xml in the browser, but what i want is to save the xml content in a file, to use in a Flash gallery.

def build_xml_menu(request):    
    rubros = Rubro.objects.all()
    familias = Familia.objects.all()
    context_data = {'rubros': rubros, 'familias': familias}
    return render_to_response('menu.xml', context_data,
                                  mimetype='application/xml')

How can i do this? Thanks.

+1  A: 

You have to use render to string instead of render_to_response :)

WoLpH
Thank you WoLpH!
Sebastian