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 attach a NativeShortUUIDField to your class::
from shortuuidfield import ShortUUIDField
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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd456b4e3b695eb3f0bd5d34930a1792251144a2a81150955368ac1f89f6766d |
|
MD5 | 3f14245c6bfc0cab90502edc90ab75ba |
|
BLAKE2b-256 | 4d3cd37c983e1d8e63b6370d57d6629a71027c1e14ede82becb414c805b4bb5a |
Close
Hashes for django_nativeshortuuidfield-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6e4d899014ef35e17c1a0c64dce4ec3135a53a10aa73ec430eb3c04d85b445e |
|
MD5 | 9e11e4613d4b3b9a2e8f98c8eac7d72a |
|
BLAKE2b-256 | 5c4cc18a8c053e47f412be29d56fbe800f47ef0c3de0114160a54041d79d398c |