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

.. |Linters| image:: https://github.com/foundertherapy/django-nativeshortuuidfield/actions/workflows/linters.yml/badge.svg :target: http://unmaintained.tech/ .. |Tests| image:: https://github.com/foundertherapy/django-nativeshortuuidfield/actions/workflows/tests.yml/badge.svg :target: http://unmaintained.tech/

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.0.tar.gz (7.7 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.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-nativeshortuuidfield-1.3.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for django-nativeshortuuidfield-1.3.0.tar.gz
Algorithm Hash digest
SHA256 37a57d0c1d1870fd89322fe4372dbc7533f55c4ac833a963b800b31a975a44ef
MD5 e9150f6592f68dfe65a37a63d28a7fce
BLAKE2b-256 2e11c13ad1509cd962995765e59c4cf660da1af9833f6aac3f48916c5ade2e04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_nativeshortuuidfield-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for django_nativeshortuuidfield-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e07be9733fa4539fdc6638b5888ae18fcc5b36b2bf21e1ab50c5611ac4596ef
MD5 9141d0dfd56a3d218d0cc865d0472e17
BLAKE2b-256 14f7b11d68fbab5f00f2674d07d91d825e1c504adc47edbd0596e6a9e64a752e

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