Skip to main content

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

  1. Django

  2. 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

sqlalchemy_get_or_create-0.1.5.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

sqlalchemy_get_or_create-0.1.5-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file sqlalchemy_get_or_create-0.1.5.tar.gz.

File metadata

  • Download URL: sqlalchemy_get_or_create-0.1.5.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.10 CPython/3.8.2 Darwin/18.7.0

File hashes

Hashes for sqlalchemy_get_or_create-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a203b067c1cb21e31c56ab475a1b7bbdf27451cce8d849785c97f79da95007ef
MD5 d94b070ed14f326ce70c7f9a2c748135
BLAKE2b-256 f8554570d4ab8c7527bb8c767ee1e19adbec9370e17c95c2af1233ffb191113f

See more details on using hashes here.

File details

Details for the file sqlalchemy_get_or_create-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_get_or_create-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7219ed18a1db98c92f162caba03e9f8bc82f0b683752d6eed953af110b36cad5
MD5 76385ac98786fb6e60b7444a6dd10e58
BLAKE2b-256 f57dd4deda0a56333ae9ea0ad2265a8b06ba4e57273d68b9f4c9bc3f10dbc6d8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page