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
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
Many to Many with through model
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
Create the app
$ cd tests/testproject
$ python ../../manage.py startapp {APP_NAME}
Change the
{APP_NAME}Config.nameinside thetests/{APP_NAME}/apps.pyfile fortests.testproject.{APP_NAME}.apps.{APP_NAME}Add the app to the
INSTALLED_APPSin the/testproject/testproject/settings.pyfileWrite the models that you would use to test on the model folder inside your app
Create the migrations using
python manage.py makemigrations {APP_NAME}Run the migrations using
python manage.py migrateCreate the tests inside the
tests/tests_orm_extractor.pyfile
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_fixtures_extractor-0.1.0.tar.gz.
File metadata
- Download URL: django_fixtures_extractor-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82c1e4556738d4b30d73727a5174525c068cf6141a5d702787ca6cafe3c28537
|
|
| MD5 |
b4398ddf2a51257fdca21a0e5d981b16
|
|
| BLAKE2b-256 |
a3b8cc7fad1b80312136692dea7e16ea545ec58b5a017a99f10e6b9d5460401e
|
File details
Details for the file django_fixtures_extractor-0.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: django_fixtures_extractor-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 8.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14e25830c1b2ac1d8f05fec25c4113cb19735567f4ad7f6bda9ea333e6803d52
|
|
| MD5 |
c5e19cf5789fe11c91cf66183485a5cd
|
|
| BLAKE2b-256 |
e02348b49f973dab0ac46ad93f6e488e2e4a6bceff4b82b02e6105a6d06d877a
|