explicit-django


Nameexplicit-django JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryНабор компонентов для интеграции explicit с django
upload_time2023-11-20 09:13:52
maintainer
docs_urlNone
authorBARS Group
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Explicit-Django
## Набор компонентов для интеграции Explicit с Django.

### Базовая единица работы на транзакциях Django ORM.

```python
# persons/core/unit_of_work.py

from explicit.django.unit_of_work import BaseUnitOfWork

from persons.core.persons.adapters.db import Repository as PersonsRepository
from persons.core.persons.adapters.db import repository as persons_repository

# (имя атрибута, инстанс репо)
KNOWN_REPOS = (
    ('persons', persons_repository),
)


class UnitOfWork(BaseUnitOfWork):

    persons: PersonsRepository

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._registry.register(*KNOWN_REPOS)
```

### Декоратор для преобразования ошибок валидации предметной области в ошибки валидации Django
```python
from explicit.django.domain.validation.exceptions import handle_domain_validation_error

class ViewSet(...):

   @handle_domain_validation_error
   def create(self, request, *args, **kwargs):
       command = Command(...)
       bus.handle(command)

```
## Запуск тестов
```sh
$ tox
```
>>>>>>> e30984f (EDUEO-552 Вынос интеграции с django в отдельный пакет.)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "explicit-django",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "BARS Group",
    "author_email": "education_dev@bars-open.ru",
    "download_url": "https://files.pythonhosted.org/packages/93/bb/06b4b4d8221e60c96f59c8b21c93081a424e461c600e42f6b4ca549afddd/explicit-django-1.0.0.tar.gz",
    "platform": null,
    "description": "# Explicit-Django\n## \u041d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Explicit \u0441 Django.\n\n### \u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u0445 Django ORM.\n\n```python\n# persons/core/unit_of_work.py\n\nfrom explicit.django.unit_of_work import BaseUnitOfWork\n\nfrom persons.core.persons.adapters.db import Repository as PersonsRepository\nfrom persons.core.persons.adapters.db import repository as persons_repository\n\n# (\u0438\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430, \u0438\u043d\u0441\u0442\u0430\u043d\u0441 \u0440\u0435\u043f\u043e)\nKNOWN_REPOS = (\n    ('persons', persons_repository),\n)\n\n\nclass UnitOfWork(BaseUnitOfWork):\n\n    persons: PersonsRepository\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self._registry.register(*KNOWN_REPOS)\n```\n\n### \u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 Django\n```python\nfrom explicit.django.domain.validation.exceptions import handle_domain_validation_error\n\nclass ViewSet(...):\n\n   @handle_domain_validation_error\n   def create(self, request, *args, **kwargs):\n       command = Command(...)\n       bus.handle(command)\n\n```\n## \u0417\u0430\u043f\u0443\u0441\u043a \u0442\u0435\u0441\u0442\u043e\u0432\n```sh\n$ tox\n```\n>>>>>>> e30984f (EDUEO-552 \u0412\u044b\u043d\u043e\u0441 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0441 django \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442.)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\u041d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 explicit \u0441 django",
    "version": "1.0.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "615ac2c281de79352833ae05fb6b6d0dafc85f74693ded0c327d1e7417dbb394",
                "md5": "9f8e4b4fd56c8ec1e89ee31b4003b7cb",
                "sha256": "7f1cd9c73f711b363bf1ddb30decb237fd44947921f5e2923100843e3956096f"
            },
            "downloads": -1,
            "filename": "explicit_django-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9f8e4b4fd56c8ec1e89ee31b4003b7cb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4489,
            "upload_time": "2023-11-20T09:13:50",
            "upload_time_iso_8601": "2023-11-20T09:13:50.183714Z",
            "url": "https://files.pythonhosted.org/packages/61/5a/c2c281de79352833ae05fb6b6d0dafc85f74693ded0c327d1e7417dbb394/explicit_django-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "93bb06b4b4d8221e60c96f59c8b21c93081a424e461c600e42f6b4ca549afddd",
                "md5": "6cc7f50d8fcd97a36fb4f3710aee689c",
                "sha256": "d352450353f761592be09849d1272826c4c22fd54a5b7c3dc1844d3a5b01c7d0"
            },
            "downloads": -1,
            "filename": "explicit-django-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6cc7f50d8fcd97a36fb4f3710aee689c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4765,
            "upload_time": "2023-11-20T09:13:52",
            "upload_time_iso_8601": "2023-11-20T09:13:52.116723Z",
            "url": "https://files.pythonhosted.org/packages/93/bb/06b4b4d8221e60c96f59c8b21c93081a424e461c600e42f6b4ca549afddd/explicit-django-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-20 09:13:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "explicit-django"
}
        
Elapsed time: 0.76134s