Skip to main content

Extensions for Django

Project description

nicedjango

Nice django tools

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

ModelGraph

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,

  • than getting all pks first chunked in steps of 10k

  • and than dump them in an order that enables correct loading.

For now the serialization is handled by django’s yaml decoder to enable queries in chunks for big data.

Examples

# show model graph parts that would be dumped and those which not:
./manage.py dump_graph -s -q 'a'
 a1.a:
   ignored subs:
     a1.a.b > a1.b

# add relations to the to be dumped graph
./manage.py dump_graph -s -q 'a' -e 'a.b'
  a1.a:
    subs:
      a1.a.b > a1.b
  a1.b:
    parents:
      a1.b.a_ptr > a1.a
    ignored subs:
      a1.b.c > a1.c

# dump all objects from myapp.models.MyModel.objects.filter(..)
./manage.py dump_graph -d dump.yaml -q 'myapp.mymodel.filter(..)'

# load dump.yaml
./manage.py load_graph dump.yaml

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

nicedjango-1.1.0.zip (24.5 kB view hashes)

Uploaded Source

nicedjango-1.1.0.tar.gz (15.1 kB view hashes)

Uploaded Source

nicedjango-1.1.0.tar.bz2 (13.2 kB view hashes)

Uploaded Source

Built Distribution

nicedjango-1.1.0-py2.py3-none-any.whl (12.7 kB view hashes)

Uploaded Python 2 Python 3

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