Skip to main content

Extended django loaddata command for uploading fixtures

Project description

Extended django loaddata command for uploading fixtures

Project Status
CI/CD Latest Release
Quality Coverage
Package PyPI - Version PyPI - Support Python Versions Project PyPI - Downloads
Meta types - Mypy License - MIT code style - Ruff

Benefits of using this cli

  1. Adds the --insert_only flag to the loaddata command, which filters existing database records from the fixture and leaves only new records to insert, thereby preventing overwriting of field values (which may have been changed by the user) in existing records when loaddata is run again.
  2. Adds the --check_fields flag, which performs the same functions as the --insert_only flag, but additionally remembers the current fields of the loaded table when the fixture is loaded for the first time, so that when adding a new field to the table and restarting loaddata, only the records from the fixture for these new fields are successfully installed, the old fields will not be changed.

Install

  1. Install package

    pip install django-loaddata
    
  2. Add app name to INSTALLED_APPS

    INSTALLED_APPS = [
        'django_loaddata',
    ]
    

Command to run the program:

python manage.py loaddata

Contributing

We would love you to contribute to django-loaddata, pull requests are very welcome! Please see CONTRIBUTING.md for more information.

Project details


Download files

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

Source Distribution

django_loaddata-0.0.1.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_loaddata-0.0.1-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file django_loaddata-0.0.1.tar.gz.

File metadata

  • Download URL: django_loaddata-0.0.1.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for django_loaddata-0.0.1.tar.gz
Algorithm Hash digest
SHA256 231d56d1d1df7058226649f60a58fc1abe24f78d27558025cee45c95e501e9d3
MD5 aa41907107ecf7d65ea57f7c2e32bdb1
BLAKE2b-256 d1d8df99060c558a9cf92aa78fb5dc8968f89aa5310232d2cad127c5577e5d77

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_loaddata-0.0.1.tar.gz:

Publisher: publish-to-pypi.yml on Friskes/django-loaddata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_loaddata-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_loaddata-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d3d2cc11d4dcb4d8b5e290770cba7fa00c48d825753f962f5badb26252c274d2
MD5 df8a6493108f8e30b36106b93d861a2d
BLAKE2b-256 3875fdc147f6624f143881940b4adb11660283cff4b047c53ef01ff9e1975d10

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_loaddata-0.0.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Friskes/django-loaddata

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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