VLK JSONField
A model JSONField with an integrated form for django.
Before doing this app we looked up for a JSONField implementation, but all that we have found had nothing that fit our needs. Our needs are just a model field to store a json string and a form that is able to validate user input against our json fields requirements.
Installation
Just copy this project to any folder in your computer or use pip.
pip install vlk-django-jsonfield
Usage
### Model
To create your JSONField just use the same notation as an usual model field:
jsonfield = VLKJSONField(null=True, default=lambda: {‘field1’: False, ‘field2’: ‘abc’})
[You must use lambda when using a dict as default] (https://docs.djangoproject.com/en/dev/ref/models/fields/#default)
### Form
To use this field in a form just use the form field with the same name of your model field and the subname separated by __:
jsonfield__field1 = forms.CharField() jsonfield__field2 = forms.IntegerField(required=False)
The right side is the usual of a form field.
Who is using
This project is used in Vialink software since January, 2013. Are you using it? Let us know :)
Contributing
Do the usual github fork and pull request dance.
License
Released under the MIT license. Read LICENSE.md for more information.
Metadata
Release files for vlk-django-jsonfield 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vlk-django-jsonfield-1.2.1.tar.gz | 3.7 kB | Without provenance | Details for vlk-django-jsonfield-1.2.1.tar.gz |
Release files / vlk-django-jsonfield-1.2.1.tar.gz
| Download URL | vlk-django-jsonfield-1.2.1.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cc6081b26970dfd721b628f8ab81d977c4476b7462140673452632d4dc83070
|
|
BLAKE2b-256 checksum How to use checksums |
02729787c0de74d565c0329f8d0215b50b04171032b659d49e1c63b7bdab8e66
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for vlk-django-jsonfield 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.