diff --git a/piccolo_api/crud/endpoints.py b/piccolo_api/crud/endpoints.py index 3b80692..bd3cadb 100644 --- a/piccolo_api/crud/endpoints.py +++ b/piccolo_api/crud/endpoints.py @@ -257,9 +257,9 @@ def __init__( table=table, exclude_secrets=exclude_secrets, max_joins=max_joins ) schema_extra["visible_fields_options"] = self.visible_fields_options - schema_extra[ - "primary_key_name" - ] = self.table._meta.primary_key._meta.name + schema_extra["primary_key_name"] = ( + self.table._meta.primary_key._meta.name + ) self.schema_extra = schema_extra root_methods = ["GET"] @@ -282,9 +282,9 @@ def __init__( Route( path="/{row_id:str}/", endpoint=self.detail, - methods=["GET"] - if read_only - else ["GET", "PUT", "DELETE", "PATCH"], + methods=( + ["GET"] if read_only else ["GET", "PUT", "DELETE", "PATCH"] + ), ), ] @@ -860,9 +860,9 @@ async def get_all( curr_page_len = curr_page_len + offset count = await self.table.count().run() curr_page_string = f"{offset}-{curr_page_len}" - headers[ - "Content-Range" - ] = f"{plural_name} {curr_page_string}/{count}" + headers["Content-Range"] = ( + f"{plural_name} {curr_page_string}/{count}" + ) # We need to serialise it ourselves, in case there are datetime # fields. diff --git a/piccolo_api/fastapi/endpoints.py b/piccolo_api/fastapi/endpoints.py index bf8d1db..d10c40e 100644 --- a/piccolo_api/fastapi/endpoints.py +++ b/piccolo_api/fastapi/endpoints.py @@ -500,7 +500,7 @@ def modify_signature( # we have a column type of ``Array(Array(Integer()))``. # For filtering purposes, we only need ``list[int]``. if _is_multidimensional_array(type_=type_): - type_ = t.List[_get_array_base_type(type_=type_)] + type_ = t.List[_get_array_base_type(type_=type_)] # type: ignore # noqa: E501 parameters.append( Parameter(