Bixomix
bixomix is a collection of SQLAlchemy mixins.
Support
- Python 3.9+
- SQLAlchemy 2.0+
Install
pip install bixomix
Usage
Add mixins after the Base class in each model’s parent classes. The order of the mixins doesn’t matter.
from sqlalchemy.orm import DeclarativeBase
from bixomix import CreatedAtMixin, EnabledMixin
class Base(DeclarativeBase):
pass
class MyModel(Base, CreatedAtMixin, EnabledMixin):
# Add your own fields here
...
Mixins
CreatedAtMixin: add acreated_atdatetime field that’s automatically filled with the record’s creation dateUpdatedAtMixin: add anupdated_atdatetime field that’s automatically filled with the record’s last update date. Note that on Postgres this is done in Python; for a database-level update you have to create a trigger.CreatedUpdatedAtMixin: combined version of the previous two mixinsEnabledMixin: add anenabledboolean field (default istrue)EnabledNoMixin: same asEnabledMixin, but the default value isfalseUpdateFromDictMixin: add anupdate_from_dictmethod to update a model in-place given a dictionary of attributes
Metadata
Release files for bixomix 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bixomix-0.1.3.tar.gz | 3.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bixomix-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / bixomix-0.1.3.tar.gz
| Download URL | bixomix-0.1.3.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
682fcd46e00ebd617890a0866405288e817fc502076fc009583de889e12cb22b
|
|
BLAKE2b-256 checksum How to use checksums |
acd9a6a8f69b747a913225306e21d1bed2df1822416ab7fb2b446ad5dd4e7040
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.10.16 Linux/6.11.0-1018-azure
|
Release files / bixomix-0.1.3-py3-none-any.whl
| Download URL | bixomix-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e019e80c4a9c57eaffed28ae847d870fce5ee0df944fcaabd96a29eafe5b3532
|
|
BLAKE2b-256 checksum How to use checksums |
0dfe73dac52cfc9b8df50c512db64bd7da2a3cd68645c329216b9c3c6fcd175a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.10.16 Linux/6.11.0-1018-azure
|