Beispiel #1
0
    def _validate_container(self):
        for field in self.model_container._meta._get_fields(reverse=False):
            if isinstance(field, (AutoField, BigAutoField, RelatedField)):
                raise ValidationError(
                    f'Field "{field}" of model container:"{self.model_container}" '
                    f'cannot be of type "{type(field)}"')

            if field.attname != field.column:
                raise ValidationError(
                    f'Field "{field}"  of model container:"{self.model_container}" '
                    f'cannot be named as "{field.attname}", different from '
                    f'column name "{field.column}"')

            if field.db_index:
                print_warn('Embedded field index')
                raise NotSupportedError(
                    f'This version of djongo does not support indexes on embedded fields'
                )
from djongo.exceptions import NotSupportedError, print_warn

print_warn('validation')


class CollectionSchema:
    def __init__(self):
        raise NotSupportedError('Collection Schema')
Beispiel #3
0
from djongo.exceptions import NotSupportedError, print_warn

print_warn('aggregation')