Skip to main content

A model decoupler for Django

Project description

Django model decoupler

django-model-decoupler enables simplification of development and separation of business logic from presentation and data persistence in Django web framework.

Install

With pipenv:

$ pipenv install django-model-decoupler

or with pip:

$ python -m pip install django-model-decoupler

Quick start

  1. Add "model_decoupler" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        ...
        'model_decoupler',
    ]
    
  2. Change your models to inherit from model_decoupler.Model:

    from django.db import models
    import model_decoupler
    from pure_python_module import PurePythonClass
    
    class MyModel(model_decoupler.Model, adaptee=PurePythonClass):
        attr1 = models.Field(...)
        ...
    
  3. Your changed MyModel should be able to act proxy to PurePythonClass from now.

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-model-decoupler-0.0.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file django-model-decoupler-0.0.1.tar.gz.

File metadata

  • Download URL: django-model-decoupler-0.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.7

File hashes

Hashes for django-model-decoupler-0.0.1.tar.gz
Algorithm Hash digest
SHA256 10f2bb3439259674ffbb33cbd5aadb531e924d3d2125716ee6b88ee02e1760c3
MD5 49713c16fb917331d307d0e71cb9afb1
BLAKE2b-256 daa1b0a99c3301d6680d05beb2b464da6ace21484d5aa4453c4b87c7b2de39f2

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