mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
bitbake: toaster: tables Move the title and name into the widget
For historical reasons this was being set in the urls definition. We can set this in the actual definition of the table and defaults in the widget. (Bitbake rev: 2f7949caec3c9194328c35b2e075eaae85409efe) Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: brian avery <avery.brian@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
e1851fe04c
commit
340b3983db
@@ -45,7 +45,7 @@ class ToasterTable(TemplateView):
|
||||
super(ToasterTable, self).__init__()
|
||||
if 'template_name' in kwargs:
|
||||
self.template_name = kwargs['template_name']
|
||||
self.title = None
|
||||
self.title = "Table"
|
||||
self.queryset = None
|
||||
self.columns = []
|
||||
self.filters = {}
|
||||
@@ -61,6 +61,13 @@ class ToasterTable(TemplateView):
|
||||
orderable=True,
|
||||
field_name="id")
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(ToasterTable, self).get_context_data(**kwargs)
|
||||
context['title'] = self.title
|
||||
context['table_name'] = type(self).__name__.lower()
|
||||
|
||||
return context
|
||||
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
if request.GET.get('format', None) == 'json':
|
||||
|
||||
Reference in New Issue
Block a user