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)
Contribution Notes
Pull Request
- Increase the version number in the
setup.py
to the new version that the new pull request represents.
Publishing the Package
After the pull request gets merged into the master branch a new release should be created
-
Create a new tag with the same version number you updated the
setup.py
with:$ git checkout master $ git tag -a 2.1.0 -m 'fix importing order' $ git push origin 2.1.0
-
Go to GitHub's releases section and create a new release:
- Chose the tag version that you just created
- Fill the release title with the same version number
- Add a description of the release and publish it
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
Hashes for django-nativeshortuuidfield-1.3.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 801ddf54130b5f836b96610e8f2bf6612c08aab97fe2dbb907677de44f1a566a |
|
MD5 | 3853cc0b431bcfbef16dbfc2446931ec |
|
BLAKE2b-256 | 91482e43db9cbee1c0aa89eb239fcbb244d8fe15356430c98f703d9b74b7e69c |
Hashes for django_nativeshortuuidfield-1.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9126936012cd325811c4d439db492d2a31cb99e214052752d4245be0b2a68a34 |
|
MD5 | b07f3f92caca4af14a6bae10fde06fec |
|
BLAKE2b-256 | c5fab4d2602bd32cbc447019c3050794e20c94a9a3771089e81d1d2ffd8aa4cd |