From acf8580a9d28b4c8c80c2b491b19e5aedc1e6f4e Mon Sep 17 00:00:00 2001 From: csae8092 Date: Tue, 5 Nov 2024 14:03:44 +0100 Subject: [PATCH] liniting --- apis_core/apis_entities/detail_views.py | 5 ++++- apis_core/apis_relations/tables.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apis_core/apis_entities/detail_views.py b/apis_core/apis_entities/detail_views.py index ea4b446..cf47b28 100644 --- a/apis_core/apis_entities/detail_views.py +++ b/apis_core/apis_entities/detail_views.py @@ -68,7 +68,10 @@ def get(self, request, *args, **kwargs): objects = objects[:50] disable_sort = True table = get_generic_relations_table( - relation_class=rel, entity_instance=instance, detail=True, disable_sort=disable_sort + relation_class=rel, + entity_instance=instance, + detail=True, + disable_sort=disable_sort, ) tb_object = table(data=objects, prefix=prefix) tb_object_open = request.GET.get(prefix + "page", None) diff --git a/apis_core/apis_relations/tables.py b/apis_core/apis_relations/tables.py index c2aa065..d7cc1dc 100644 --- a/apis_core/apis_relations/tables.py +++ b/apis_core/apis_relations/tables.py @@ -44,11 +44,9 @@ class GenericRelationListViewTable(tables.Table): render_start_date_written = generic_render_start_date_written render_end_date_written = generic_render_end_date_written - class Meta: model = relation_class - # the fields list also serves as the defining order of them, as to avoid duplicated definitions fields = [ related_entity_field_name_a, @@ -90,7 +88,9 @@ def __init__(self, *args, **kwargs): return GenericRelationListViewTable -def get_generic_relations_table(relation_class, entity_instance, detail=None, disable_sort=False): +def get_generic_relations_table( + relation_class, entity_instance, detail=None, disable_sort=False +): """ Creates a table class according to the relation and entity class given by the parameters.