mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
UUIDModel doc
This commit is contained in:
parent
ca75294883
commit
5bf7db036f
1 changed files with 21 additions and 0 deletions
|
|
@ -55,3 +55,24 @@ SoftDeletableModel
|
|||
This abstract base class just provides field ``is_removed`` which is
|
||||
set to True instead of removing the instance. Entities returned in
|
||||
default manager are limited to not-deleted instances.
|
||||
|
||||
|
||||
UUIDModel
|
||||
------------------
|
||||
|
||||
This abstract base class provides ``id`` field on any model that inherits from it
|
||||
which will be the primary key.
|
||||
|
||||
If you dont want to set ``id`` as primary key or change the field name, you can be override it
|
||||
with our [UUIDField](https://github.com/jazzband/django-model-utils/blob/master/docs/fields.rst#uuidfield).
|
||||
|
||||
Also you can override the default uuid version. Versions 1,3,4 and 5 are now supported.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from model_utils.models import UUIDModel
|
||||
from model_utils import Choices
|
||||
|
||||
class MyAppModel(UUIDModel):
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue