'Initialises the Cached Reference Field.
:param fields:  A list of fields to be cached in document
:param auto_sync: if True documents are auto updated.'

def __init__(self, document_type, fields=None, auto_sync=True, **kwargs):

    if (fields is None):
        fields = []
    if ((not isinstance(document_type, six.string_types)) and (not issubclass(document_type, Document))):
        self.error('Argument    to    CachedReferenceField    constructor    must    be    a    document    class    or    a    string')
    self.auto_sync = auto_sync
    self.document_type_obj = document_type
    self.fields = fields
    super(CachedReferenceField, self).__init__(**kwargs)
