Login

Tag "stream"

Snippet List

A streamable "export to CSV" admin action

This snippets is inspired from [#2995](https://djangosnippets.org/snippets/2995/) but add the following: * get rid of `singledispatch` so we can use it with python2 without pip installing anything * streaming capabilities * the configuration params (header, fields, exclude...) are passed to the action function so we don't pollute the ModelAdmin class * fix utf8 issue in header

  • admin
  • export
  • csv
  • action
  • stream
  • export-csv
Read More

streaming dump_data

`dumpdata` without `MemoryErrors`, with progress notification. Most of the real work is done by snippets [1400](http://www.djangosnippets.org/snippets/1400/) and [1401](http://www.djangosnippets.org/snippets/1401/). ./manage.py dumpdata_stream --format=xml > big_dump.xml This is basically the stock Django `dumpdata` with a few modifications. Django devs: it's hard to reuse parts of most Django management commands. A little refactoring could go a long way.

  • dumpdata
  • memoryerror
  • stream
  • dump_data
  • queryset_foreach
Read More

2 snippets posted so far.