Familiar asyncio ORM for python, built with relations in mind
APACHE-2.0 License
Bot releases are visible (Hide)
Published by grigi about 5 years ago
Published by grigi about 5 years ago
None
None
Published by grigi about 5 years ago
«queryset».update(…)
now correctly uses the DB-specific to_db_value()
fetch_related(…)
now correctly encodes non-integer keys.ForeignKey
fields of type UUIDField
are now escaped consistently.UUIDField
) is now checked for persistence correctly..add(…)
now checks using consistent field encoding.source_field
Fields are now handled correctly for ordering.source_field
Fields are now handled correctly for updating.Published by grigi about 5 years ago
Security fixes for «model».save()
& «model».dete()
:
This is now fully parametrized, and these operations are no longer susceptible to escaping issues.
Performance improvements:
BigIntField
for MySQL and PostgreSQL.SmallIntField
as a auto-gen Primary Key.Published by grigi about 5 years ago
Model schema now has a discovery API:
One can call Tortoise.describe_models()
or Tortoise.describe_model(<Model>)
to get
a full description of the model(s).
Please see tortoise.Tortoise.describe_model
and tortoise.Tortoise.describe_models
for more info.
MySQL
"schema": "custom"
var in credentials
or as a query parameter ?schema=custom
utf8mb4
. If a charset is provided it will also force the TABLE charset to the same.Published by grigi about 5 years ago
This release brings with it, deprecation of Python 3.5
We will increase the minimum supported version of Python to 3.6, as 3.5 is reaching end-of-life,
and is missing many useful features for async applications.
We will discontinue Python 3.5 support on the next major release (Likely 0.14.0)
.values()
and .values_list()
now default to all fields if none are specified.generate_schema()
now generates well-formatted DDL SQL statements.TruncationTestCase
testing class that truncates tables to allow faster testing of transactions.obj.save(update_fields=['model','field','names'])
ForeignKeyField
and ManyToManyField
source_field
values definedsource_field
values definedgenerate_schema.py
examplerelations_recirsive.py
example (turned into test case)Published by grigi about 5 years ago
Re-release of v0.12.6 due to a regression in v0.12.7
Published by grigi about 5 years ago
Published by grigi about 5 years ago
__models__
variable within modules to override the model discovery mechanism:__models__
variable in yourapp.models
(or wherever you specify to load your models from),generate_schema()
will use that list, rather than automatically finding all models for you.Published by grigi over 5 years ago
make check
returns better error message on black
errors.Published by grigi over 5 years ago
Published by grigi over 5 years ago
Published by grigi over 5 years ago
Published by grigi over 5 years ago
The bulk insert operation will do the minimum to ensure that the object created in the DB has all the defaults and generated fields set, but may be incomplete reference in Python.
e.g. IntField
primary keys will not be poplulated.
This is recommend only for throw away inserts where you want to ensure optimal insert performance.
User.bulk_create([
User(name="...", email="..."),
User(name="...", email="...")
])
Also: Notable efficiency improvement for regular inserts
Published by grigi over 5 years ago
We currently support single (non-composite) primary keys of any indexable field type, but only these field types are recommended:
IntField
BigIntField
CharField
UUIDField
The primary key will be accessible through a reserved field pk
which will be an alias of whichever field has been nominated as a primary key.
The alias field can be used as a field name when doing filtering e.g. .filter(pk=...)
etc...
One must define a primary key by setting a pk
parameter to True
.
If you don't define a primary key, we will create a primary key of type IntField
with name of id
for you.
Published by grigi over 5 years ago
Published by grigi over 5 years ago
Published by grigi over 5 years ago
Published by grigi over 5 years ago
Published by grigi over 5 years ago
black
, and minor code cleanups (#120 #123)