Orm

Latest version: v0.3.1

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.3.1

Added
* SQLAlchemy filter operators https://github.com/encode/orm/pull/130


Fixed
* Change private methods to internal https://github.com/encode/orm/pull/133
* Change `create_all` and `drop_all` to async https://github.com/encode/orm/pull/135


**Full Changelog**: https://github.com/encode/orm/compare/0.3.0...0.3.1

0.3.0

Added

* Support for `ON DELETE` actions (115)
* `OneToOne` field (116)
* `Email` field (123)
* `IPAddress` field (124)
* Model class `__repr__` and `__str__` methods (127)
* `URL` field (128)

Fixed

* `create` method not working for non-integer Primary Keys (119)

0.2.1

Added

* Queryset-level delete method (111)
* Queryset-level update method (112)
* `update_or_create` convenience method (113)

0.2.0

Version `0.2.0` depends on `typesystem>=0.3.0` for validation. This release changes how model fields are defined, now they are defined as a `dict` in the `fields`attribute of the model.

python
import databases
import orm


database = databases.Database("sqlite:///db.sqlite")
models = orm.ModelRegistry(database=database)


class Note(orm.Model):
tablename = "notes"
registry = models
fields = {
"id": orm.Integer(primary_key=True),
"text": orm.String(max_length=100),
"completed": orm.Boolean(default=False),
}


There's no need for sync database drivers like `psycopg2` for creating and destorying tables. `ModelRegistry` can do that now:

python
models.create_all()

models.drop_all()

0.1.9

Added

* Add `UUID` field (105)
* Add `get_or_create` method (106)

0.1.8

Added

- `Decimal` field - 104

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.