Skip to content

Commit

Permalink
liniting
Browse files Browse the repository at this point in the history
  • Loading branch information
csae8092 committed Nov 5, 2024
1 parent 77d6c36 commit acf8580
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion apis_core/apis_entities/detail_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions apis_core/apis_relations/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit acf8580

Please sign in to comment.