Releases: encode/orm
Releases · encode/orm
Version 0.3.1
Version 0.3.0
Version 0.2.1
Version 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.
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:
models.create_all()
models.drop_all()
Version 0.1.9
Version 0.1.8
Added
Decimal
field - #104