Skip to content

Instantly share code, notes, and snippets.

@Starou
Created February 26, 2014 10:25
Show Gist options
  • Save Starou/9227210 to your computer and use it in GitHub Desktop.
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
Copy link

ornoone commented Jun 27, 2016

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

@tiago-henriques
Copy link

tiago-henriques commented Apr 21, 2021

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