Django model field metadata and utilities
Project description
django-model-field-meta
An easy-to-use plugin to allow optional metadata of model fields.
Compatible with django-model-utils
, safedelete
, etc.
Tested on Python 3+, Django 2.1+.
Example
from model_field_meta import models, FieldMetaMixin
class MyModel(FieldMetaMixin, models.Model):
my_field = models.TextField(meta={"key": "value"})
model_obj = MyModel.objects.first()
model_obj.get_field_meta("my_field")
# {"key": "value"}
Installation
Install from PiPy:
pip install django-model-field-meta
or, if you are using Pipenv:
pipenv install django-model-field-meta
Why metadata in model field?
In one of my Django projects, I needed to supply extra information about our model fields.
For my purpose, help_text
is too limited. Using code comments is not feasible as I need to use those information programatically.
Hence, django_model_field_meta
package is created.
Compatibility with third-party packages
In my project, I use:
django-model-utils
for itsInheritanceManager
.safedelete
for itsSafeDeleteModel
So far, I haven't encounter any issue. Feel free to report if you do.
Issues
If you have questions or issues using it, please create a Github issue at:
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
Built Distribution
Hashes for django-model-field-meta-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e1f78f92c4638181ffa7ee102f82610541a5b8b17a58d890b85e47a625b1071 |
|
MD5 | a356706c6b748828955de03783bb182f |
|
BLAKE2b-256 | ec2d3b14528cbd09b94a183119e63833876501d3624e694f687fbb697a5fdcbe |
Hashes for django_model_field_meta-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0904d78bd73b49d5b5302807da9d952595f0a247afd60d78976267336c3af7c |
|
MD5 | 3c6f71bebbeb8ba2a7bbd4cc35e262cf |
|
BLAKE2b-256 | b6b55ad193f3321751ce51c971f9e4e76a07904b24dc34b2db2cd21e8568e16e |