Context manager for default relationship values in SQLAlchemy
Project description
============================== Model Relative Context Manager
.. image:: https://img.shields.io/pypi/v/sqla_model_context.svg :target: https://pypi.python.org/pypi/sqla_model_context
.. image:: https://github.com/alexrudy/sqla_model_context/workflows/CI/badge.svg :target: https://github.com/alexrudy/sqla_model_context/workflows/CI/
.. image:: https://readthedocs.org/projects/sqla-model-context/badge/?version=latest :target: https://sqla-model-context.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
Context manager for default relationship values in SQLAlchemy
- Free software: MIT license
- Documentation: https://sqla-model-context.readthedocs.io.
This is primarily a way to ensure that common relationships (e.g. user_id on lots of user generated content) are easy
to set via the SQLAlchemy context. It works well in concert with flask_login, where it allows you to leverage flask_login's
current_user
to set a default relationship value. See the examples directory for a small usage example.
Credits
This package was created with Cookiecutter_ and the audreyr/cookiecutter-pypackage
_ project template.
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _audreyr/cookiecutter-pypackage
: https://github.com/audreyr/cookiecutter-pypackage
Project details
Release history Release notifications | RSS feed
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
Hashes for sqla_model_context-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0098428be5c494a579f24e921097cd0c078bf334d042dcf107aac0c1dbf76e6 |
|
MD5 | 6d85a4e5ea31ccd25348a200ff8ebed4 |
|
BLAKE2b-256 | 6d45fa7da096f23f19fb178b932966f47a78c391a4bb8861942e3669544dec48 |