MCPcopy
hub / github.com/kennethreitz/records / all

Method all

records.py:195–207  ·  view source on GitHub ↗

Returns a list of all rows for the RecordCollection. If they haven't been fetched yet, consume the iterator and cache the results.

(self, as_dict=False, as_ordereddict=False)

Source from the content-addressed store, hash-verified

193 return data
194
195 def all(self, as_dict=False, as_ordereddict=False):
196 """Returns a list of all rows for the RecordCollection. If they haven't
197 been fetched yet, consume the iterator and cache the results."""
198
199 # By calling list it calls the __iter__ method
200 rows = list(self)
201
202 if as_dict:
203 return [r.as_dict() for r in rows]
204 elif as_ordereddict:
205 return [r.as_dict(ordered=True) for r in rows]
206
207 return rows
208
209 def as_dict(self, ordered=False):
210 return self.all(as_dict=not (ordered), as_ordereddict=ordered)

Callers 4

datasetMethod · 0.95
as_dictMethod · 0.95
queryMethod · 0.95

Calls 1

as_dictMethod · 0.45

Tested by 1