github tortoise/tortoise-orm 0.12.0
v0.12.0

latest releases: 0.20.0, 0.19.3, 0.19.2...
4 years ago

Tortoise ORM now supports non-autonumber primary keys.

This is a big feature change. It should not break any existing implementations.

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.

Don't miss a new tortoise-orm release

NewReleases is sending notifications on new releases.