def _validate_schema(self, schema):
        if not isinstance(schema, list):
            raise ValueError('schema parameter must be a list')

        if len(schema) == 0:
            raise ValueError('schema parameter cannot be an empty list')

        for field in schema:
            if not isinstance(field, dict):
                raise ValueError('schema parameter must contain dicts representing fields, read the docs to see the format')
            if 'name' not in field:
                raise ValueError('schema element %s is missing the name key' % field)
            if 'class' not in field:
                raise ValueError('schema element %s is missing the class key' % field)
dataset/ETHPy150Open djangonauts/django-hstore/django_hstore/fields.py/DictionaryField._validate_schema/original