Набор компонентов для интеграции explicit с django
Project description
Explicit-Django
Набор компонентов для интеграции Explicit с Django.
Базовая единица работы на транзакциях Django ORM.
# 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
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)
Запуск тестов
$ tox
e30984f (EDUEO-552 Вынос интеграции с django в отдельный пакет.)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file explicit_python_django-1.1.0.tar.gz.
File metadata
- Download URL: explicit_python_django-1.1.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7899bcb28d52bcc3a8e7f2c2d6e1813dc605235914ef1788b220e60e35f0469
|
|
| MD5 |
69c6410563017536d577557ca6cf0d7a
|
|
| BLAKE2b-256 |
8a2e9aca99577222866dd060b404242d7594a0551d1d5e17d10e982aaa287a62
|
File details
Details for the file explicit_python_django-1.1.0-py3-none-any.whl.
File metadata
- Download URL: explicit_python_django-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b987fb0fb560b0232d9ec89450d21fffce1f4c1c86d272c6875f9ff4b80680d
|
|
| MD5 |
fcbc2b89c39b3f14428c794d02f592ce
|
|
| BLAKE2b-256 |
0a13831d964c94d79072d27d3b4c79e37b29b8a4320124c2b62f123df5ccd4ec
|