semvec/pypi-packages huggingface dataset:
django-modelmultivalue 0.21
A form field to create a related model sub-form
License: MIT License

====================
ModelMultiValueField
====================

ModelMultiValueField provides the ability to create sub-forms for foreign models without having to worry about writing
the ModelMultiValueField subclasses.

Quick start
-----------

1. Add "modelmultivalue" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        ...
        'modelmultivalue',
    ]

2. Add the ModelMultiValueField to a model form

    a. All django version::

        from django import forms
        from modelmultivalue import ModelMultiValueField

        class ExampleModelForm(forms.ModelForm):
            class Meta:
                model = Example
                fields = '__all__'

            ForeignKeyField = ModelMultiValueField(model=ForeignKey

    b. for Django>=1.9::

        from django import forms
        from modelmultivalue import ModelMultiValueField

        class ExampleModelForm(forms.ModelForm):
            class Meta:
                model = Example
                fields = '__all__'
                field_classes={
                    'ForeignKeyField': ModelMultiValueField
                }
dictspec 0.2.1
validator for JSON/YAML/dict data
License: MIT License

dictspec – Validator for JSON/YAML/dicts
========================================

dictspec is a simple Python library that validates dictionary and list based data structures.
You can use it to validate JSON/YAML documents against your own specification.

It is MIT licensed and uses relative imports, so you can just drop it into your project.

Examples
--------

Validate against plain Python data objects or types:

    >>> spec = {
    ...   'foo': 1,
    ...   'bar': [basestring],
    ... }
    >>> data = {
    ...   'foo': 4,
    ...   'bar': ['hello', u'w\x00F6rld']}
    ... }
    >>> from dictspec.validator import validate
    >>> validate(spec, data)


Use more complex specs and get detailed errors:

    >>> from dictspec.spec import number, required
    >>> spec = {
    ...   required('foo'): number(),
    ...   'bar': bool(),
    ... }
    >>> data = {
    ...                 # missing 'foo' key
    ...   'bar': 4,     # wrong type
    ...   'baz': True,  # unknown key
    ... }
  
    >>> from dictspec.validator import ValidationError
    >>> try:
    ...   validate(spec, data)
    ... except ValidationError, ex:
    ...   print ex.errors
    ["missing 'foo' not in .", "unknown 'baz' in .", '4 in bar not of type bool']


Also with recursion and arbitrary keys:

    >>> from dictspec.spec import anything, recursive
    >>> spec = {
    ...   'hello': recursive({
    ...     anything(): recursive(),
    ...   })
    ... }
    >>> data = {
    ...   'hello': {'any': {'thing': {'recursive':{}}}}
    ... }
    >>> validate(spec, data)