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.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7038e2e240e61e3ab80d165c7ed1ee88962676c55cb30f172ba53842fbecf108 |
|
MD5 | ea061a12330c92fe528344d16bcdafe6 |
|
BLAKE2b-256 | 1460d4a744847d7c2899973d4258cce55abeb3b8780146fa82825974e0bf8360 |
Close
Hashes for django_nativeshortuuidfield-1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd3a68f382814e8c72ee612e536968fd4a9454a800a87e317e57199334814fd |
|
MD5 | 3697a11b3b1cf3540f17f46b64c16870 |
|
BLAKE2b-256 | 98098d6c76dc9c53e5b9652ca8aedcb33071db715fa822c02b0c0f9e2f5e6dd1 |