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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 091c56116b39a23155bac7571bd8601d8bd1e820d99235192159006fb507820d |
|
MD5 | 59b13b411f38164271cf099ab06ac175 |
|
BLAKE2b-256 | 5112608570277925fc56c4c5df278ccfe781349c601f3f5951c1afb3654bb144 |
Close
Hashes for django_nativeshortuuidfield-1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d638bddd68a3a617bad961c10540976f3cb18bae3a0210769826519b40e5b99c |
|
MD5 | 89dd2ef45dba71328be4aca6bbd91ffc |
|
BLAKE2b-256 | bc68ea598e8082c7040c9fa5bf2dc8dedfa46829f88ac18499383ffc3c306ac1 |