Skip to content

Instantly share code, notes, and snippets.

@Starou
Created February 26, 2014 10:25
Show Gist options
  • Select an option

  • Save Starou/9227210 to your computer and use it in GitHub Desktop.

Select an option

Save Starou/9227210 to your computer and use it in GitHub Desktop.
Fork of Django's dumpdata management command with an option to select related models to dump as well.
@ornoone

ornoone commented Jun 27, 2016

Copy link
Copy Markdown

work but the related flag is obscure and undocumented, no exemple, and don't seem to be recursive.

@tiago-henriques

tiago-henriques commented Apr 21, 2021

Copy link
Copy Markdown

BaseCommand.option_list was deprecated in Django 1.8 and has been removed in Django 1.10, so this code no longer works.

You also need to use collections.OrderedDict or something similar, as django.utils.datastructures.SortedDict was removed in Django 1.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment