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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 707d8c5b61e0c999566094574042d3b263a0badce582ed737efc1a0c665bdc58 |
|
MD5 | 63ba897890e145e138d42ac8910044de |
|
BLAKE2b-256 | b35e899e43d3741375808e0c30952c393124bf88eb6c21e6412a73997b651fca |
Close
Hashes for django_nativeshortuuidfield-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5652e06096acf0dced69181a91f29b534b415ff3ad08e6d83f0194afe654e35c |
|
MD5 | 9125dc725e77333d04dc0be28268e68e |
|
BLAKE2b-256 | 67a480c3c5d021207894367f20db03b10e5147204fafb504ae92779cb59d7745 |