'Initialises the Reference Field.
:param dbref:  Store the reference as :class:`~pymongo.dbref.DBRef`
or as the :class:`~pymongo.objectid.ObjectId`.id .
:param reverse_delete_rule: Determines what to do when the referring
object is deleted
.. note ::
A reference to an abstract document type is always stored as a
:class:`~pymongo.dbref.DBRef`, regardless of the value of `dbref`.'

def __init__(self, document_type, dbref=False, reverse_delete_rule=DO_NOTHING, **kwargs):

    if ((not isinstance(document_type, six.string_types)) and (not issubclass(document_type, Document))):
        self.error('Argument    to    ReferenceField    constructor    must    be    a    document    class    or    a    string')
    self.dbref = dbref
    self.document_type_obj = document_type
    self.reverse_delete_rule = reverse_delete_rule
    super(ReferenceField, self).__init__(**kwargs)
