SQLAlchemy versions of Django's get_or_create() and update_or_create()
Project description
SQLAlchemy get_or_create()
SQLAlchemy versions of Django’s get_or_create() and update_or_create()
Installation
To get the latest stable release from PyPi
pip install sqlalchemy_get_or_create
Usage
get_or_create(session, model, defaults=None, **kwargs)
Same as Django’s get_or_create() but also takes the SQLAlchemy session and model
update_or_create(session, model, defaults=None, **kwargs)
Same as Django’s update_or_create() but also takes the SQLAlchemy session and model
Acknowledgments
Django
Some code cribbed from https://skien.cc/blog/2014/01/15/sqlalchemy-and-race-conditions-implementing-get_one_or_create/
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
Close
Hashes for sqlalchemy_get_or_create-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dda1f5c931233d41ea8db9ec053bcecefaf3d6e151ab9f920d687d8f5f7198e |
|
MD5 | 38da1134db9480f505402d406c49fe66 |
|
BLAKE2b-256 | a06fd04e6d916fb2e36af70a11625cfcb60205c3f5bc4b9cb3b6e873918ab463 |
Close
Hashes for sqlalchemy_get_or_create-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a21f812b65744dcf688c2b7207d986edb9fc0a3ad029bdcdbf0a5f482e461389 |
|
MD5 | 3de1de05be2c5c2ef48bd2659e9d2b9b |
|
BLAKE2b-256 | 070b4e21a6a62e66622ff0b8d9d5fefc4ac22b1859215378b767fa2fdebde563 |