Skip to main content

Nice extensions for django

Project description


Nice django tools

Build Status Coveralls Documentation Status Requirements Status Downloads Latest Version Supported Python versions Supported Python implementations Development Status Wheel Status Egg Status Download format License


Selective dumping and loading of only the needed model data for all objects and their related objects of one or more querysets.

This is done by

  • getting a graph of all relations between models,

  • getting all pks first in chunks,

  • dump them in an order that enables correct loading.


# show model graph parts that would be dumped and those which not:
# example for query model a1.A with relation to child a1.B(A)
./ dump_graph -p -q a -r a.b
               a1-a.b          to child  
               a1-a.f          to foreign          a1-f.a
              to parent 
               a1-b.c          to child  
               a1-b.e          to child  

# dump all objects from a1.models.A.objects.filter() with relation a.b as compact yaml:
./ dump_graph -f dump.yaml -s compact_yaml -q a.filter(pk__in=(1,2)) -r a.b
    - a1-a: [pk]
     - [1]
     - [2]
     - a1-b: [pk]
     - [2]

# load back the dumped dump.yaml
./ load_graph -f dump.yaml -s compact_yaml

# by default serializing into compact csv files is enabled:
mkdir dump_folder
./ dump_graph -f dump_folder -q a.filter(pk__in=(1,2)) -r a.b
#results in two files under dump_folder:
# a1-a.csv:
# and a1-b.csv:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions (46.9 kB view hashes)

Uploaded source

nicedjango-1.2.0.tar.gz (28.6 kB view hashes)

Uploaded source

nicedjango-1.2.0.tar.bz2 (23.4 kB view hashes)

Uploaded source

Built Distribution

nicedjango-1.2.0-py2.py3-none-any.whl (29.0 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page