mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Add linters configs
This commit is contained in:
@@ -1,15 +1,17 @@
|
||||
from app.models import Author
|
||||
|
||||
from app.services.common import TRGMSearchService, GetRandomService
|
||||
|
||||
|
||||
GET_OBJECT_IDS_QUERY = """
|
||||
SELECT ARRAY(
|
||||
WITH filtered_authors AS (
|
||||
SELECT
|
||||
WITH filtered_authors AS (
|
||||
SELECT
|
||||
id,
|
||||
GREATEST(
|
||||
similarity((last_name || ' ' || first_name || ' ' || middle_name), :query),
|
||||
similarity(
|
||||
(last_name || ' ' || first_name || ' ' || middle_name),
|
||||
:query
|
||||
),
|
||||
similarity((last_name || ' ' || first_name), :query),
|
||||
similarity((last_name), :query)
|
||||
) as sml,
|
||||
@@ -27,7 +29,7 @@ SELECT ARRAY(
|
||||
EXISTS (
|
||||
SELECT * FROM book_authors
|
||||
LEFT JOIN books ON (books.id = book AND books.is_deleted = 'f')
|
||||
WHERE author = authors.id
|
||||
WHERE author = authors.id
|
||||
)
|
||||
)
|
||||
SELECT fauthors.id FROM filtered_authors as fauthors
|
||||
|
||||
Reference in New Issue
Block a user