Skip to main content

Django extension for flexible import and merge

Project description

djfim

License

Apache License Version 2.0

Usage

a) declare concrete datamodel:

# app/models.py
from django.db import models
from djfim.models import Blob, Entity, Generation

class MyBlob(Blob):
    class Meta:
        abstract = False

class MyEntity(Entity):
    generation = models.ForeignKey('MyGeneration', on_delete=models.CASCADE, null=False)
    blob = models.ForeignKey('MyBlob', on_delete=models.CASCADE, null=False)

    class Meta:
        abstract = False

class MyGeneration(Generation):
    l_anchor = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, related_name='l_subtree')
    r_anchor = models.ForeignKey('self', on_delete=models.SET_NULL, null=True, related_name='r_subtree')

    class Meta:
        abstract = False

b) migrate datamodel:

python manage.py makemigrations
pythno manage.py migrate

c) setup datamodel reference:

# project/settings.py
DJFIM = {
    'MODLE': {
        'BLOB': {
            'app_name': 'app',
            'app_label': 'MyBlob',
        },
    }
}

d) invoke management command:

python manage.py fim [action]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

djfim-0.5.8-py3-none-any.whl (38.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page