Django extension for fixture import and merge
Project description
djfim
Django extension of Fixture Import and Merge
License
Apache License Version 2.0
Usage
manage.py fim /path/to/fixture.json
Config
It's as easy as 1-2-3.
- Define a sub-class of
djfim.models.FURecord
in your application'smodels.py
from djfim.models import FURecord
class YourAppFixture(FURecord):
'''sub-class'''
class Meta:
abstract = False
- Set up correct model name in your project's
settings.py
DJFIM = {
'MODEL': {
'app_name': 'demoapp',
'app_label': 'YourAppFixture'
}
}
- Invoke the commands to update database schema
python manage.py makemigrations
python manage.py migrate
Customize
Release number is automatically incremented each time the new fixture data is applied.
The release number increment policy is controlled via RELEASE_INCREMENT_POLICY
field.
Currently only two options are available: PLUS_ONE
and PLUS_TEN
.
An example is shown below:
# settings.py
DJFIM = {
'RELEASE_INCREMENT_POLICY': 'PLUS_TEN',
# other config items
# ...
}
TODO
- add unittest
- add support for user defined release number provider (or increment policy)
- drop support for Django 1.x and 2.x
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
djfim-0.2.0.tar.gz
(11.3 kB
view hashes)