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

  • Make pipinstallable

  • Run CI/CD

Desired features

  • Add support for Django 1.11 to 5

  • Add supported model fields
  • Add feature: Obfuscate value

  • Add feature: Generate schema from model

  • Fix tox and pyenv to work together

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.1.tar.gz (7.1 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.1-py2.py3-none-any.whl (8.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django_fixtures_extractor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7836b5d9909e9c4c07c9aa8fbf6e077b777ab94e28a64d20a6638ef2bc8b425b
MD5 3434032c6945653af0ccda4a805b4d9c
BLAKE2b-256 12589d91454293fbc1fdc046c7cce17504351edd35aa26bf8937ecd31eec58e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_fixtures_extractor-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 49b9067479ac16f580eeaf5d6dfa71c7ec61865e4faa8fbd8e144f06b486244d
MD5 0fa5f8c27a44549285a3788479d740d9
BLAKE2b-256 dcec70fe42dc751b4fd2a1653bc1ba15b2a838e01b11b6e269852d9a9e9d495e

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