# Path: blitzdb/fields/char.py
# class CharField(BaseField):
# 
#     def __init__(self, length=None, *args, **kwargs):
#         self.length = length
#         super(CharField, self).__init__(*args, **kwargs)
# 
# Path: blitzdb/fields/base.py
# class BaseField(object):
# 
#     def __init__(
#         self,
#         key=None,
#         nullable=True,
#         unique=False,
#         default=None,
#         primary_key=False,
#         server_default=None,
#         indexed=False,
#     ):
#         self.key = key
#         self.nullable = nullable
#         self.indexed = indexed
#         self.primary_key = primary_key
#         self.default = default
#         self.server_default = server_default
#         self.unique = unique


import copy
import logging
import uuid
import six
from blitzdb.fields import CharField
from blitzdb.fields.base import BaseField

    def __str__(self):
        message = BaseException.__str__(self)
        return u"DoesNotExist({}): {}".format(self.__class__.__name__, message)

class MultipleDocumentsReturned(BaseException):

    def __str__(self):
        message = BaseException.__str__(self)
        return u"MultipleDocumentsReturned({}): {}".format(self.__class__.__name__, message)

class MetaDocument(type):

    """
    Here we inject class-dependent exceptions into the Document class.
    """

    def __new__(meta, name, bases, dct):
        sanitized_dct = {}
        sanitized_dct['fields'] = {}

        class_type = type.__new__(meta, name, bases, dct)

        fields = {}

        #we inherit the fields from the base type(s)
        if hasattr(class_type,'fields'):
            fields.update(class_type.fields)

        for key,value in dct.items():

# Path: blitzdb/fields/char.py
# class CharField(BaseField):
# 
#     def __init__(self, length=None, *args, **kwargs):
#         self.length = length
#         super(CharField, self).__init__(*args, **kwargs)
# 
# Path: blitzdb/fields/base.py
# class BaseField(object):
# 
#     def __init__(
#         self,
#         key=None,
#         nullable=True,
#         unique=False,
#         default=None,
#         primary_key=False,
#         server_default=None,
#         indexed=False,
#     ):
#         self.key = key
#         self.nullable = nullable
#         self.indexed = indexed
#         self.primary_key = primary_key
#         self.default = default
#         self.server_default = server_default
#         self.unique = unique


# Path: blitzdb/document.py
import copy
import logging
import uuid
import six
from blitzdb.fields import CharField
from blitzdb.fields.base import BaseField


    def __str__(self):
        message = BaseException.__str__(self)
        return u"DoesNotExist({}): {}".format(self.__class__.__name__, message)

class MultipleDocumentsReturned(BaseException):

    def __str__(self):
        message = BaseException.__str__(self)
        return u"MultipleDocumentsReturned({}): {}".format(self.__class__.__name__, message)

class MetaDocument(type):

    """
    Here we inject class-dependent exceptions into the Document class.
    """

    def __new__(meta, name, bases, dct):
        sanitized_dct = {}
        sanitized_dct['fields'] = {}

        class_type = type.__new__(meta, name, bases, dct)

        fields = {}

        #we inherit the fields from the base type(s)
        if hasattr(class_type,'fields'):
            fields.update(class_type.fields)

        for key,value in dct.items():

            if isinstance(value,BaseField):