Properly determine which fields to show
This commit is contained in:
parent
867d86cf6c
commit
47b6255f68
|
@ -178,14 +178,7 @@ class DrilldownTableView(SingleTableView):
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
self.object_list = self.get_queryset(request)
|
self.object_list = self.get_queryset(request)
|
||||||
show = []
|
show = []
|
||||||
if len(self.object_list) > 0:
|
show = set().union(*(d.keys() for d in self.object_list))
|
||||||
first = self.object_list[0]
|
|
||||||
fields = first.keys()
|
|
||||||
for field in fields:
|
|
||||||
# values_present = all([x[field] is not None for x in self.object_list])
|
|
||||||
# if values_present:
|
|
||||||
if field not in show:
|
|
||||||
show.append(field)
|
|
||||||
allow_empty = self.get_allow_empty()
|
allow_empty = self.get_allow_empty()
|
||||||
|
|
||||||
if not allow_empty:
|
if not allow_empty:
|
||||||
|
|
Loading…
Reference in New Issue