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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a6553be14ff943e4e714fbc338eb76690b397a84cb31a30d079cc86eba69453 |
|
MD5 | 9eef383fdc7ed5e858b78a76f0a77099 |
|
BLAKE2b-256 | 62fce27fe6fc531433d6fe9bbb4d683194dd82e13afa317c6240ea8979204fe1 |
Close
Hashes for django_nativeshortuuidfield-1.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45b89c177d47db5c9a311a4fc7df64ad65a87c6f8efe1c2e35eabb6d84abcc1f |
|
MD5 | 7c15f49abc94530c96715b81681a45c0 |
|
BLAKE2b-256 | 03e767f29162c68af953f9e9abfdd71cd93b0ffaf9c45d4f42d09c7b3d7b9fe0 |