Skip to content

Commit 9d7108c

Browse files
committed
refactor(python): remove spaces around equal sign
1 parent 6547d71 commit 9d7108c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

examples/python/fastapi/postgres/routes.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_v1_categories_count(conn=Depends(db_connection)):
2626
cur.execute("SELECT COUNT(*) AS counter FROM categories")
2727
result = cur.fetchone()
2828
if result is None:
29-
raise HTTPException(status_code = status.HTTP_404_NOT_FOUND)
29+
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
3030
return result
3131
finally:
3232
conn.close()
@@ -66,7 +66,7 @@ def get_v1_collections_collection_id_categories_count(collectionId, conn=Depends
6666
""", {"collectionId": collectionId})
6767
result = cur.fetchone()
6868
if result is None:
69-
raise HTTPException(status_code = status.HTTP_404_NOT_FOUND)
69+
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
7070
return result
7171
finally:
7272
conn.close()
@@ -90,7 +90,7 @@ def get_list_v1_categories(conn=Depends(db_connection)):
9090
conn.close()
9191

9292

93-
@router.post('/v1/categories', status_code = status.HTTP_204_NO_CONTENT)
93+
@router.post('/v1/categories', status_code=status.HTTP_204_NO_CONTENT)
9494
def post_v1_categories(body: CreateCategoryDto, conn=Depends(db_connection)):
9595
try:
9696
with conn:
@@ -137,13 +137,13 @@ def get_v1_categories_category_id(categoryId, conn=Depends(db_connection)):
137137
""", {"categoryId": categoryId})
138138
result = cur.fetchone()
139139
if result is None:
140-
raise HTTPException(status_code = status.HTTP_404_NOT_FOUND)
140+
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
141141
return result
142142
finally:
143143
conn.close()
144144

145145

146-
@router.put('/v1/categories/{categoryId}', status_code = status.HTTP_204_NO_CONTENT)
146+
@router.put('/v1/categories/{categoryId}', status_code=status.HTTP_204_NO_CONTENT)
147147
def put_v1_categories_category_id(body: CreateCategoryDto, categoryId, conn=Depends(db_connection)):
148148
try:
149149
with conn:
@@ -162,6 +162,6 @@ def put_v1_categories_category_id(body: CreateCategoryDto, categoryId, conn=Depe
162162
conn.close()
163163

164164

165-
@router.delete('/v1/categories/{categoryId}', status_code = status.HTTP_204_NO_CONTENT)
165+
@router.delete('/v1/categories/{categoryId}', status_code=status.HTTP_204_NO_CONTENT)
166166
def delete_v1_categories_category_id():
167167
pass

src/templates/routes.py.ejs

+4-4
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def <%- pythonMethodName %>(<%- methodArgs.join(', ') %>):
244244
<% } else { /* GET with a single result */ -%>
245245
result = cur.fetchone()
246246
if result is None:
247-
raise HTTPException(status_code = status.HTTP_404_NOT_FOUND)
247+
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
248248
return result
249249
<%
250250
}
@@ -266,7 +266,7 @@ def <%- pythonMethodName %>(<%- methodArgs.join(', ') %>):
266266
267267
%>
268268
269-
@router.post('<%- path %>', status_code = status.HTTP_204_NO_CONTENT)
269+
@router.post('<%- path %>', status_code=status.HTTP_204_NO_CONTENT)
270270
<%# LATER: deal with methodArgs -%>
271271
def <%- pythonMethodName %>(body: <%- model %>, conn=Depends(db_connection)):
272272
try:
@@ -292,7 +292,7 @@ def <%- pythonMethodName %>(body: <%- model %>, conn=Depends(db_connection)):
292292
const formattedParams = formatParamsAsPythonDict(params)
293293
%>
294294
295-
@router.put('<%- path %>', status_code = status.HTTP_204_NO_CONTENT)
295+
@router.put('<%- path %>', status_code=status.HTTP_204_NO_CONTENT)
296296
def <%- pythonMethodName %>(<%- methodArgs.join(', ') %>):
297297
try:
298298
with conn:
@@ -306,7 +306,7 @@ def <%- pythonMethodName %>(<%- methodArgs.join(', ') %>):
306306
if (method.name === 'delete') {
307307
%>
308308
309-
@router.delete('<%- path %>', status_code = status.HTTP_204_NO_CONTENT)
309+
@router.delete('<%- path %>', status_code=status.HTTP_204_NO_CONTENT)
310310
def <%- pythonMethodName %>():
311311
pass
312312
<%

0 commit comments

Comments
 (0)