We're not the
idyou don't know what to do with, we're the other one.
django-descriptive-id adds a field to django for automatically generated human-readable identifiers.
DescriptiveIDField field added by django-descriptive-id requires a single parameter
prefix, which will be used as the prefix for a unique human-readable character string.
pip install descriptive-id
descriptive_id to your
INSTALLED_APPS = ( ... 'descriptive_id', ... )
DescriptiveIDField to any model:
from descriptive_id.fields import DescriptiveIDField number = DescriptiveIDField(prefix='my_prefix')
django-descriptive-id will append a random (but human-readable) string to the given prefix and store the result in the field when an instance is added.
For the above example that might look something like:
If you need to do development over this library, you can make use of the example application to test your developments.
Create a new virtual environment using virtualenv, and install the requirements from the example app into the virtual environment:
pip install -r example/requirements.txt
When you have made changes to the library, install the library into your virtual environment directly:
python setup.py install
The example app can then be initialized with migrations that make use of the field with your copy of the code installed.