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',
    ]
    
  3. Run django migrate

    python manage.py migrate
    

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.2.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.2-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_loaddata-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 823880af95bb1c3fa7cde44b187fbe0bb17584d2b1cd44cb9ca79beaa67499bd
MD5 7c8d57b36fc1d05af7672bb0180c240b
BLAKE2b-256 d4d18b9a8f82f6d7ca2f22096651b329739d58f38b147222d029c2e912997a6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_loaddata-0.0.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_loaddata-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f594ffb70da0a7c2e539ccd44b362515b7b6bd5231a1e852b1f3c7f3354e5430
MD5 d7a23f4fe6f84d3717fb6f007d2380f8
BLAKE2b-256 a311f55fb5ae90035b4d8bc636d44c139bb0156aad935edb7308e397af9773d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_loaddata-0.0.2-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