Familiar asyncio ORM for python, built with relations in mind
APACHE-2.0 License
Bot releases are hidden (Show)
Published by grigi almost 5 years ago
Published by grigi almost 5 years ago
TextField
now recommends usage of CharField
if wanting unique indexing instead of just saying "indexing not supported".count()
now honours offset and limit (#167)ForeignKeyField
as a boolean expression will automatically resolve as False
if it is None (#274)ForeignKeyField
won't touch the DB if it is None
(#274)Published by grigi almost 5 years ago
QuerySet.Update()
now returns the count of the no of rows affected. Note, thatQuerySet.Delete()
now returns the count of the no of rows deleted.db_connection.execute_query()
now returns rows_affected, results
. (This is informational only)get_or_none(...)
as syntactic sugar for filter(...).first()
Published by grigi almost 5 years ago
BinaryField
for storing binary objects (bytes
).TextField
to use LONGTEXT
for MySQL to allow for larger than 64KB of text.index=true
and as part of indexes
TextField
is marked as deprecated.related_name=False
Published by grigi almost 5 years ago
Refactored Fields:
Fields have been refactored, for better maintenance. There should be no change for most users.
describe_model()
now returns the DB type, and dialect overrides.JSONField
will now automatically use python-rapidjson
as an accelerator if it is available.DecimalField
and aggregations on it, now behaves much more like expected on SQLite (#256)Published by grigi almost 5 years ago
RuntimeWarning
when a module has no models to import (#254)Published by grigi almost 5 years ago
Added OneToOneField
implementation:
OneToOneField
describes a one to one relation between two models.
It can be set from the primary side only, but resolved from both sides in the same way.
describe_model(...)
now also reports OneToOne relations in both directions.
Usage example:
event: fields.OneToOneRelation[Event] = fields.OneToOneField(
"models.Event", on_delete=fields.CASCADE, related_name="address"
)
Published by grigi almost 5 years ago
auto_now_add
argument of DatetimeField
is handled correctly in the SQLite backend. (#248)unique_together
now creates named constrains, to prevent the DB from auto-assigning a potentially non-unique constraint name. (#237)auto_now
field doesn't replace the filter value with now()
anymore. (#249)Published by grigi almost 5 years ago
Q()
correctly (#240)Published by grigi almost 5 years ago
minsize
and maxsize
connection parametersDateField
& DatetimeField
deserializes faster on PostgreSQL & MySQL..values()
to do less copying, resulting in a slight speedup.Q()
objects as parameters to Q()
objects simultaneously.indexes
will correctly map the foreign key if referenced by name.start_transaction
is deprecated, please use @atomic()
or async with in_transaction():
instead.
This release brings with it, deprecation of Python 3.6 / PyPy-3.6:
This is due to small differences with how the backported aiocontextvars
behaves
in comparison to the built-in in Python 3.7+.
There is a known context confusion, specifically regarding nested transactions.
Published by grigi almost 5 years ago
alias
is now no longer reserved.Published by grigi almost 5 years ago
ManyToManyField
is now a function that has the type of the relation for autocomplete,Published by grigi almost 5 years ago
This release drops support of Python 3.5:
Tortoise ORM now requires a minimum of CPython 3.6 or PyPy3.6-7.1
Trim()
, Length()
, Coalesce()
, Lower()
, Upper()
added to tortoise.functions module.Queryset.values()
and Queryset.values_list()
expressions.await
-able as long as one didn't populate it via .prefetch_related()
Meta:
class using indexes
. It works just like unique_toghether
.UNIQUE
statements.KEY
statements.unique_together
and indexes
will correctly map the foreign key if referenced by name.import from tortoise.aggregation
is deprecated, please do import from tortoise.functions
instead.Published by grigi about 5 years ago
Field
class now calls super().__init__
, so mixins are properly initialised." as it was causing issues on Python 3.6.Published by grigi about 5 years ago
_FieldMeta
class not to checking if the 1st base class was Field, so would break with mixins.Field
class now calls super().__init__
, so mixins are properly initialised.Published by grigi about 5 years ago
Published by grigi about 5 years ago
type
parameter of Field.__init__
is removed, instead we use the 2nd base classPublished by grigi about 5 years ago
MySQL
where non-integer Primary-Keys did not get declared properly (#195)Published by grigi about 5 years ago
__iexact
filter modifier was implemented. Queries like «queryset».filter(name__iexact=...)
will perform case-insensitive search.Published by grigi about 5 years ago
Model.__init__
where we raise the wrong error on setting RFK/M2M values directly.Queryset.values_list()
is now in the defined Model order.Queryset.values()
is now in the defined Model order.