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

Method _get_scalar

mongoengine/queryset/base.py:1981–1992  ·  view source on GitHub ↗
(self, doc)

Source from the content-addressed store, hash-verified

1979 return key_list
1980
1981 def _get_scalar(self, doc):
1982 def lookup(obj, name):
1983 chunks = name.split("__")
1984 for chunk in chunks:
1985 obj = getattr(obj, chunk)
1986 return obj
1987
1988 data = [lookup(doc, n) for n in self._scalar]
1989 if len(data) == 1:
1990 return data[0]
1991
1992 return tuple(data)
1993
1994 def _sub_js_fields(self, code):
1995 """When fields are specified with [~fieldname] syntax, where

Callers 3

in_bulkMethod · 0.95
__next__Method · 0.95
__getitem__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected