Skip to main content

Django Object Dump

Installation

  1. Installation is easy using pip.

    $ pip install django-objectdump
  2. Add to INSTALLED_APPS

  3. Optionally add configuration information (OBJECTDUMP_SETTINGS)

Settings

OBJECTDUMP_SETTINGS = {
    'MODEL_SETTINGS': {
        'app.model': {
            'ignore': False,
            'fk_fields': True,  # or False, or ['whitelist', 'of', 'fks']
            'm2m_fields': True,  # or False, or ['whitelist', 'of', 'm2m fields']
            'addl_relations': []  # callable or 'othermodel_set.all' strings
        }
    }
}
ignore

If True, always ignore this model. Acts as if you used --exclude with this model.

fk_fields

If False, do not include related objects through foreign keys. Otherwise, a white-list of foreign keys to include related objects.

m2m_keys

If False, do not include related objects through many-to-many fields. Otherwise, a white-list of many-to-many field names to include related objects.

addl_relations

A list of callables, which get passed an object, or strings in Django template syntax ('author_set.all.0' becomes 'object.author_set.all.0' and evaluates to object.author_set.all()[0])

Options

--format

Default: json

Specifies the output serialization format for fixtures. Options depend on SERIALIZATION_MODULES settings. xml and json and yaml are built-in.

--indent

Default: None

Specifies the indent level to use. The default will not do any pretty-printing or indenting of content.

--database

Default: DEFAULT_DB_ALIAS

Nominates a specific database to dump fixtures from. Defaults to the “default” database.

-e, --exclude

Default: []

An appname or appname.ModelName to exclude (use multiple --exclude to exclude multiple apps/models).

-n, --natural

Default: False

Use natural keys if they are available.

--depth

Default: None

Max depth related objects to get. The initial object specified is considered level 0. The default will get all objects.

--limit

Default: None

Max number of related objects to get. Default gets all related objects.

-i, --include

Default: all

An appname or appname.ModelName to whitelist related objects included in the export (use multiple --include to include multiple apps/models).

--idtype

Default: 'int'

The natural type of the id(s) specified. Options are: int, unicode, long

--debug

Default: False

Output debug information. Shows what related objects each object generates. Use with --verbosity 2 to also see which fields are the link.

Metadata

Release files for django-objectdump 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for django-objectdump 0.5.2
File Interpreter ABI Platform Actions
django_objectdump-0.5.2-py2-none-any.whl Python 2 none any Details for django_objectdump-0.5.2-py2-none-any.whl

Release files / django_objectdump-0.5.2-py2-none-any.whl

Download URL django_objectdump-0.5.2-py2-none-any.whl
Size 16.3 kB
Tags Python 2
SHA-256 checksum
How to use checksums
e06138011abf9504a7ece2a9529dd3595620c49a71ab1491b6876f305faa3c6d
BLAKE2b-256 checksum
How to use checksums
39a09dc19abd352a2574b2900cf605ac1b4fc93f85d9956af17b93736ab7d72f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-objectdump 0.5.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page