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 details)

Uploaded Python 3

File details

Details for the file djfim-0.5.8-py3-none-any.whl.

File metadata

  • Download URL: djfim-0.5.8-py3-none-any.whl
  • Upload date:
  • Size: 38.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 PyPy/7.3.7

File hashes

Hashes for djfim-0.5.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5191b75a2f57eb5f0f1fe21d1892305b4151207039107dca7f7c6e6f9249c313
MD5 2c5da999ef5569a520378ec793c1b85c
BLAKE2b-256 14c79b9d23be267bf0354c42af92a9fac9442918fb89487f2ac3beb87914135b

See more details on using hashes here.

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