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.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3b24e9800026929695fb489dfd931347102ab429995f2ca5ca14efd9d71b957 |
|
MD5 | d77a6788d72553cdae4feca556f6c703 |
|
BLAKE2b-256 | a2901734f5883e69a8f9c07a1e3f4cc551480443cfbac0582705d10a41fbd14e |
Close
Hashes for django_nativeshortuuidfield-1.2.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 434e5fdf77882c1f99bba60cd1fcb1d21ed0cb6aea288d7c2ac8af81cae618b8 |
|
MD5 | 9b7955c715fcd01da96a284b32ede27b |
|
BLAKE2b-256 | 9afc14d69bc43edb41971c2e653ec0f207a984aa9b31348fdf7db13065c3365e |