summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2015-06-05 12:30:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-12 00:01:48 +0100
commitc941743c9a1310c1b5ef942fa6e6d1ed31a7faa7 (patch)
tree19a7e7c37848359f98f50fb260fe1b45be8ceb56 /bitbake/lib/toaster/toastergui/views.py
parent58600cf8e76f270969ded6ec63ac0908f39dae09 (diff)
downloadpoky-c941743c9a1310c1b5ef942fa6e6d1ed31a7faa7.tar.gz
bitbake: toaster: ToasterTables add computational fields
This patch adds the ability to pass a function to be computed for generating a field value in setting up a column in ToasterTables. Also adding "displayable" property that can be turned False for columns that are present in JSON data but are not part of the UI. Add the "id" column by default for all rows. (Bitbake rev: fb683135348b074412da154585c75865aad1eab0) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rwxr-xr-xbitbake/lib/toaster/toastergui/views.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 280159ad2c..c25c512a84 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -112,6 +112,9 @@ def objtojson(obj):
112 elif isinstance(d[di], int) and hasattr(obj, "get_%s_display" % di): 112 elif isinstance(d[di], int) and hasattr(obj, "get_%s_display" % di):
113 nd[di] = getattr(obj, "get_%s_display" % di)() 113 nd[di] = getattr(obj, "get_%s_display" % di)()
114 return nd 114 return nd
115 elif isinstance( obj, type(lambda x:x)):
116 import inspect
117 return inspect.getsourcelines(obj)[0]
115 else: 118 else:
116 raise TypeError("Unserializable object %s (%s) of type %s" % ( obj, dir(obj), type(obj))) 119 raise TypeError("Unserializable object %s (%s) of type %s" % ( obj, dir(obj), type(obj)))
117 120