A decoder/encoder Field for uuid
Project description
django-nativeshortuuidfield
Provides a NativeShortUUIDField for your Django models which uses the base-57 "Short UUID" package at https://github.com/stochastic-technologies/shortuuid/ to be used in Python and store it as full UUID in database.
Installation
Install it with pip (or easy_install)::
pip install django-nativeshortuuidfield
Usage
First you'll need to add a NativeShortUUIDField to your class::
from native_shortuuid import NativeShortUUIDField
class MyModel(models.Model):
uuid = NativeShortUUIDField(unique=True, default=uuid.uuid4)
Enjoy!
Notes
-
NativeShortUUIDField is a subclass of django.db.models.UUIDField
-
You can pass usual Django UUIDField parameters on init, although some of them are added/overwritten:
- blank=True, editable=False (set auto=False to remove these fields enforcement)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-nativeshortuuidfield-1.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eca1b3d4b9dd7200798d77ffe02b9509a8ed752e22a5614d1e3a5e48fc1dc90e |
|
MD5 | 6e13a4f9a1b33d7bad49e785a6fe9972 |
|
BLAKE2b-256 | 8b738c59eadd36976583bc8bed7d6bdd36ae5f7e2ebf67a477f01107cbaf223a |
Close
Hashes for django_nativeshortuuidfield-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 665cb4c672395efc38ab5e6b1b36fb310205c82fac8718ec991dfe1c6911c28d |
|
MD5 | 8dfac3991d9d9b11bf6ac81258610e9e |
|
BLAKE2b-256 | 683852a1746904addb75d41ac5912963e83b1a1e8ef683f3216e404239724cb0 |