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 decoupler
    from pure_python_module import PurePythonClass
    
    class MyModel(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.2.tar.gz (2.7 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: django-model-decoupler-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 944e8680ad7602e185b9720cf2e0de253feb722b372a9c756a0a6a700dc3a7ad
MD5 1933af835955c4299488fc463778ecea
BLAKE2b-256 f4f9f5b5675dafc301154073f2600fcddc3c8cf9e9b97485278aaed46d7bc1bd

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