pyramid_autowire
pyramid_autowire is a package that allows your pyramid views to use pyramids registry for dependency injection.
from pyramid_autowire import autowired
@view_defaults(route_name='test_route', mapper=autowired)
class Posts:
def __init__(
# Standard pyramid (context, request) and (request,) arguments
# are available through position-only args
self, request, /,
# the database and user objects will be injected from the registry
database: IDatabase, active_user: IUser
):
self.request = request
self.database = database
self.active_user = active_user
@view_config()
def view_post(
self, *,
# the matchdict is injected as keyword-only args
post_id
):
return self.database.query(Post, post_id)
def includeme(config):
registry = config.registry
# pretend for the example that the database session is global
registry.registerUtility(MyDatabase(), IDatabase)
def get_active_user(request):
# Fetch active user from the request data
...
registry.registerAdapter(get_active_user, (IRequest, ), IUser)
Metadata
Release files for pyramid-autowire 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyramid_autowire-1.0.2.tar.gz | 4.2 kB | Without provenance | Details for pyramid_autowire-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyramid_autowire-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for pyramid_autowire-1.0.2-py3-none-any.whl |
Total release size: 9.2 kB
Release files / pyramid_autowire-1.0.2.tar.gz
| Download URL | pyramid_autowire-1.0.2.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d76de8d7ee33cad8ace125324de9186ee4bead7bd52e6618ad9f80dae97f1f94
|
|
BLAKE2b-256 checksum How to use checksums |
c20438d5c395755335f91260981ffbf478926ee5a239daeba3a34b437654edc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Release files / pyramid_autowire-1.0.2-py3-none-any.whl
| Download URL | pyramid_autowire-1.0.2-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd0f21616eae0e5e8ad4e8d22fd5562cb3497113a25457298b1fcfc2026b5380
|
|
BLAKE2b-256 checksum How to use checksums |
3b1f03f83417d79e8c0d9425cdaf4501e43ef7ded12fe82fa38cc7197c42ad3f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2
|
Security for pyramid-autowire 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.