MCPcopy Index your code
hub / github.com/clips/pattern / json

Method json

pattern/db/__init__.py:1873–1880  ·  view source on GitHub ↗

Returns a JSON-string, as a list of dictionaries (if fields are defined) or as a list of lists. This is useful for sending a Datasheet to JavaScript, for example.

(self)

Source from the content-addressed store, hash-verified

1871
1872 @property
1873 def json(self):
1874 """ Returns a JSON-string, as a list of dictionaries (if fields are defined) or as a list of lists.
1875 This is useful for sending a Datasheet to JavaScript, for example.
1876 """
1877 if self.fields is not None:
1878 return json([dict((f[0], row[i]) for i, f in enumerate(self.fields)) for row in self])
1879 else:
1880 return json(self)
1881
1882 @property
1883 def array(self):

Callers

nothing calls this directly

Calls 1

jsonFunction · 0.85

Tested by

no test coverage detected