Login

Snippets by jordic

Snippet List

Generic admin action export selected rows to excel

Based on [http://djangosnippets.org/snippets/1697/](http://djangosnippets.org/snippets/1697/) but improved with multiline fields, and unicode chars. Also it generates an xls file, not a csv one. Requires, pyExcelerator *Usage:* Add the code to your project, e.g. a file called actions.py in the project root. Register the action in your apps admin.py: from myproject.actions import export_as_xls class MyAdmin(admin.ModelAdmin): actions = [export_as_xls]

  • export
  • admin-actions
  • xls
Read More

jordic has posted 1 snippet.