Skip to main content

Set of tools to extract fixtures from Django models navigating through the relationships of a given model to get a usable subset of the database.

Project description

https://badge.fury.io/py/django-fixtures-extractor.svg https://travis-ci.org/matibarriento/django-fixtures-extractor.svg?branch=master https://codecov.io/gh/matibarriento/django-fixtures-extractor/branch/master/graph/badge.svg

Extract specific data to a django fixture

Documentation

The full documentation is at https://django-fixtures-extractor.readthedocs.io.

Quickstart

Install Django Fixtures Extractor:

pip install django-fixtures-extractor

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'fixtures_extractor',
    ...
)

TODO Features

  • Run CI/CD

Desired features

  • Add supported model fields
  • Add feature: Obfuscate value

  • Add feature: Generate schema from model

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ python runtests.py

Development commands

pip install -r requirements/requirements_dev.txt
pip install -r requirements/requirements_test.txt

How to add a new app and add tests

  1. Create the app

$ cd tests/testproject
$ python ../../manage.py startapp {APP_NAME}
  1. Change the {APP_NAME}Config.name inside the tests/{APP_NAME}/apps.py file for tests.testproject.{APP_NAME}.apps.{APP_NAME}

  2. Add the app to the INSTALLED_APPS in the /testproject/testproject/settings.py file

  3. Write the models that you would use to test on the model folder inside your app

  4. Create the migrations using python manage.py makemigrations {APP_NAME}

  5. Run the migrations using python manage.py migrate

  6. Create the tests inside the tests/tests_orm_extractor.py file

Credits

Based on https://github.com/ascaliaio/django-dumpdata-one

Tools used in rendering this package:

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_fixtures_extractor-0.1.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

django_fixtures_extractor-0.1.2-py2.py3-none-any.whl (8.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_fixtures_extractor-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django_fixtures_extractor-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b769697b1f07937c5739ed487115d00dae48412fc04dd31bdddb37985089adfd
MD5 998b476ef6e22bf0ece663974115e5aa
BLAKE2b-256 834477164b0687fbe3756d743e01b6c8d541bb35ab7d98d58611e1664f39e747

See more details on using hashes here.

File details

Details for the file django_fixtures_extractor-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_fixtures_extractor-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 88f1a5223924dddb97d2cc169a6d6fd9e1ef4cacee93aeac80f6edc6281c3e0a
MD5 cc44d114ab8cd76e1bf2c321cbd18477
BLAKE2b-256 e84727e711f9627fb229a4fedee2cc8734aa1659ed330ff86a65f4d25de85bd4

See more details on using hashes here.

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