summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/tables.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/tables.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/tables.py')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index b75e565246..e540b91499 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -79,7 +79,7 @@ class LayersTable(ToasterTable):
79 self.add_column(title="Git repository URL", 79 self.add_column(title="Git repository URL",
80 help_text="The Git repository for the layer source code", 80 help_text="The Git repository for the layer source code",
81 hidden=True, 81 hidden=True,
82 static_data_name="git_url", 82 static_data_name="layer__vcs_url",
83 static_data_template=git_url_template) 83 static_data_template=git_url_template)
84 84
85 git_dir_template = ''' 85 git_dir_template = '''
@@ -328,13 +328,17 @@ class RecipesTable(ToasterTable):
328 self.add_column(title="Revision", 328 self.add_column(title="Revision",
329 field_name="layer_version__get_vcs_reference") 329 field_name="layer_version__get_vcs_reference")
330 330
331
332 self.add_column(title="Build", 331 self.add_column(title="Build",
333 help_text="Add or delete recipes to and from your project", 332 help_text="Add or delete recipes to and from your project",
334 hideable=False, 333 hideable=False,
335 static_data_name="add-del-layers", 334 static_data_name="add-del-layers",
336 static_data_template='{% include "recipe_btn.html" %}') 335 static_data_template='{% include "recipe_btn.html" %}')
337 336
337 self.add_column(title="Project compatible Layer ID",
338 displayable = False,
339 field_name = "projectcompatible_layer",
340 computation = lambda x: (x.layer_version.get_equivalents_wpriority(Project.objects.get(pk=kwargs['pid']))[0]))
341
338class LayerRecipesTable(RecipesTable): 342class LayerRecipesTable(RecipesTable):
339 """ Smaller version of the Recipes table for use in layer details """ 343 """ Smaller version of the Recipes table for use in layer details """
340 344