Skip to content

Instantly share code, notes, and snippets.

@jheasly
Last active August 29, 2015 14:21
Show Gist options
  • Save jheasly/e94c8c283b103d954159 to your computer and use it in GitHub Desktop.
Save jheasly/e94c8c283b103d954159 to your computer and use it in GitHub Desktop.
Non-encoded object_list
from django.views.generic.list_detail import object_list
from foo.models import Baz
...
def foo(request):
response = object_list(
request,
queryset = Baz.objects.order_by('date'),
template_name = 'my_template.html',
mimetype = 'text/plain',
)
response['Content-Disposition'] = 'attachment; filename=InDesign_tagged_text.txt'
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment