From c941743c9a1310c1b5ef942fa6e6d1ed31a7faa7 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Fri, 5 Jun 2015 12:30:12 +0100 Subject: 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 Signed-off-by: Richard Purdie --- bitbake/lib/toaster/toastergui/tables.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/tables.py') 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): self.add_column(title="Git repository URL", help_text="The Git repository for the layer source code", hidden=True, - static_data_name="git_url", + static_data_name="layer__vcs_url", static_data_template=git_url_template) git_dir_template = ''' @@ -328,13 +328,17 @@ class RecipesTable(ToasterTable): self.add_column(title="Revision", field_name="layer_version__get_vcs_reference") - self.add_column(title="Build", help_text="Add or delete recipes to and from your project", hideable=False, static_data_name="add-del-layers", static_data_template='{% include "recipe_btn.html" %}') + self.add_column(title="Project compatible Layer ID", + displayable = False, + field_name = "projectcompatible_layer", + computation = lambda x: (x.layer_version.get_equivalents_wpriority(Project.objects.get(pk=kwargs['pid']))[0])) + class LayerRecipesTable(RecipesTable): """ Smaller version of the Recipes table for use in layer details """ -- cgit v1.2.3-54-g00ecf