JSON schema model for django.
Project description
1 Welcome to django-json-schema-model’s documentation!
- Version:
0.1.0
- Source:
- Keywords:
<keywords>
- PythonVersion:
3.10
A reusable Django app to store JSON schemas.
2 Features
- JsonSchemaModel consisting of
name CharField
schema JsonField
validate(json) method to validate JSON against the schema.
3 Installation
3.1 Requirements
Python 3.10 or above
Django 4.2 or newer
A database supporting django.db.models.JSONField
3.2 Install
pip install django-json-schema-model
4 Usage
from django_json_schema_model.models import JsonSchema
class ProductType(models.Model):
schema = models.ForeignKey(JsonSchema, on_delete=models.PROTECT)
class Product(models.Model):
json = models.JsonField()
type = models.ForeignKey(ProductType, on_delete=models.CASCADE)
def clean(self):
self.type.schema.validate(self.json)
5 Local development
To install and develop the library locally, use:
.. code-block:: bash
pip install -e .[tests,coverage,docs,release]
When running management commands via django-admin, make sure to add the root directory to the python path (or use python -m django <command>):
export PYTHONPATH=. DJANGO_SETTINGS_MODULE=testapp.settings
django-admin check
# or other commands like:
# django-admin makemessages -l nl
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_json_schema_model-0.1.0.tar.gz.
File metadata
- Download URL: django_json_schema_model-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46df2680f2600d4f650b5b3ca44252cda90647c0bc315b51eeca911fc53b31af
|
|
| MD5 |
dceddeba5f3f4c1963a2ce0dbdfb845b
|
|
| BLAKE2b-256 |
d17834bc8fca28086aa33d943b1e3b241f046fa2ad51231085bb5fb0494caaf4
|
Provenance
The following attestation bundles were made for django_json_schema_model-0.1.0.tar.gz:
Publisher:
ci.yml on maykinmedia/django-json-schema-model
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_json_schema_model-0.1.0.tar.gz -
Subject digest:
46df2680f2600d4f650b5b3ca44252cda90647c0bc315b51eeca911fc53b31af - Sigstore transparency entry: 163179644
- Sigstore integration time:
-
Permalink:
maykinmedia/django-json-schema-model@313d88d951139e417f7632b560747a33ba904fd4 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/maykinmedia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@313d88d951139e417f7632b560747a33ba904fd4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_json_schema_model-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_json_schema_model-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
410aab367b93186590f051f0f9a1566366ce850763ac8d51eacc41d08ba04fc3
|
|
| MD5 |
914499402dd592e06aa118c1520e3515
|
|
| BLAKE2b-256 |
15e38a304ac57ba1c0aba4ae88b0cf27e236e74350c87321d21b211c0e7863c0
|
Provenance
The following attestation bundles were made for django_json_schema_model-0.1.0-py3-none-any.whl:
Publisher:
ci.yml on maykinmedia/django-json-schema-model
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_json_schema_model-0.1.0-py3-none-any.whl -
Subject digest:
410aab367b93186590f051f0f9a1566366ce850763ac8d51eacc41d08ba04fc3 - Sigstore transparency entry: 163179647
- Sigstore integration time:
-
Permalink:
maykinmedia/django-json-schema-model@313d88d951139e417f7632b560747a33ba904fd4 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/maykinmedia
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@313d88d951139e417f7632b560747a33ba904fd4 -
Trigger Event:
push
-
Statement type: