Skip to main content

A decoder/encoder Field for uuid

Project description

django-nativeshortuuidfield

Tests Linters

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-nativeshortuuidfield-1.3.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_nativeshortuuidfield-1.3.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file django-nativeshortuuidfield-1.3.3.tar.gz.

File metadata

File hashes

Hashes for django-nativeshortuuidfield-1.3.3.tar.gz
Algorithm Hash digest
SHA256 d57a3e5f9ddfe2b8c60cecdaa8723bc11abec2a35d659f429293b2a6327ca0ba
MD5 63f9f97198cf593994955573a668c08a
BLAKE2b-256 5179db663f8c708252cc592957350f7d35b25b1069b49b4c2e70d1db7c37e6d7

See more details on using hashes here.

File details

Details for the file django_nativeshortuuidfield-1.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_nativeshortuuidfield-1.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3417ee729ff7490f29da1014f33e495e95fbc43bb1095ea26967cdd75cb90661
MD5 38c04442b1958e84eb8ba7b3d12373f4
BLAKE2b-256 cc8fc7b222a23305c4986648605dbc2a0ca6a2aa527a08dc57c6cef070454a07

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page