django-jsonschema converts Django Forms into JSON Schema compatibile representations
Project description
Introduction
django-jsonschema converts Django Forms into JSON Schema compatibile representations
Requirements
Python 2.6 or later
Django 1.4 or later
Usage
To convert a form to a JSON Schema:
from djangojsonschema.jsonschema import DjangoFormToJSONSchema schema_repr = DjangoFormToJSONSchema().convert_form(MyForm)
To embed a JSON Schema as a form field:
from djangojsonschema.forms import JSONSchemaField #where schema is a python dictionay like schema_repr in the first exmaple class MyForm(forms.Form): subfield = JSONSchemaField(schema=schema) form = MyForm(data={'subfield':'<json encoded value>'}) form.validate() #will validate the subfield entry against schema form['subfield'].as_widget() #will render a textarea widget with a data-schemajson attribute
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
Close
Hashes for django-jsonschema-0.1.0.macosx-10.9-intel.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98d3d5f80740fb6c9a7482e256b84c8967d8b9e0a4a7a260a79c42d6693ae69b |
|
MD5 | 8201b63492b1c0af59371421bab40885 |
|
BLAKE2b-256 | 884236948b3590f07343f26b8265281d243fc90fd16f030f960fa15662dce2fb |