MCPcopy Index your code
hub / github.com/MongoEngine/mongoengine / to_dbref

Method to_dbref

mongoengine/document.py:831–837  ·  view source on GitHub ↗

Returns an instance of :class:`~bson.dbref.DBRef` useful in `__raw__` queries.

(self)

Source from the content-addressed store, hash-verified

829 return value
830
831 def to_dbref(self):
832 """Returns an instance of :class:`~bson.dbref.DBRef` useful in
833 `__raw__` queries."""
834 if self.pk is None:
835 msg = "Only saved documents can have a valid dbref"
836 raise OperationError(msg)
837 return DBRef(self.__class__._get_collection_name(), self.pk)
838
839 @classmethod
840 def register_delete_rule(cls, document_cls, field_name, rule):

Callers 5

to_mongoMethod · 0.80
test_to_dbrefMethod · 0.80
test_db_ref_usageMethod · 0.80
test_reference_missMethod · 0.80

Calls 2

OperationErrorClass · 0.85
_get_collection_nameMethod · 0.45

Tested by 4

test_to_dbrefMethod · 0.64
test_db_ref_usageMethod · 0.64
test_reference_missMethod · 0.64