def get_ref(self, key): if isinstance(self.get(key, None), DBRef): return self[key].dereference(self.collection.database)