Added backend support to perform exact matches

This commit is contained in:
Donkie
2024-05-25 20:53:48 +02:00
parent 65bfba89cf
commit b00075ab87
5 changed files with 66 additions and 16 deletions

View File

@@ -174,7 +174,8 @@ async def find(
title="Vendor Name",
description=(
"Partial case-insensitive search term for the filament vendor name. "
"Separate multiple terms with a comma. Specify an empty string to match filaments with no vendor name."
"Separate multiple terms with a comma. Specify an empty string to match filaments with no vendor name. "
"Surround a term with quotes to search for the exact term."
),
),
vendor_id: Optional[str] = Query(
@@ -193,7 +194,8 @@ async def find(
title="Filament Name",
description=(
"Partial case-insensitive search term for the filament name. Separate multiple terms with a comma. "
"Specify an empty string to match filaments with no name."
"Specify an empty string to match filaments with no name. "
"Surround a term with quotes to search for the exact term."
),
),
material: Optional[str] = Query(
@@ -201,7 +203,8 @@ async def find(
title="Filament Material",
description=(
"Partial case-insensitive search term for the filament material. Separate multiple terms with a comma. "
"Specify an empty string to match filaments with no material."
"Specify an empty string to match filaments with no material. "
"Surround a term with quotes to search for the exact term."
),
),
article_number: Optional[str] = Query(
@@ -210,7 +213,8 @@ async def find(
description=(
"Partial case-insensitive search term for the filament article number. "
"Separate multiple terms with a comma. "
"Specify an empty string to match filaments with no article number."
"Specify an empty string to match filaments with no article number. "
"Surround a term with quotes to search for the exact term."
),
),
color_hex: Optional[str] = Query(
@@ -231,7 +235,8 @@ async def find(
description=(
"Find filaments imported by the given external ID. "
"Separate multiple IDs with a comma. "
"Specify empty string to match filaments with no external ID."
"Specify empty string to match filaments with no external ID. "
"Surround a term with quotes to search for the exact term."
),
example="polymaker_pla_polysonicblack_1000_175",
),

View File

@@ -170,8 +170,9 @@ async def find(
default=None,
title="Filament Name",
description=(
"Partial case-insensitive search term for the filament name. Separate multiple terms with a comma."
" Specify an empty string to match spools with no filament name."
"Partial case-insensitive search term for the filament name. Separate multiple terms with a comma. "
"Specify an empty string to match spools with no filament name. "
"Surround a term with quotes to search for the exact term."
),
),
filament_id: Optional[str] = Query(
@@ -188,7 +189,8 @@ async def find(
title="Filament Material",
description=(
"Partial case-insensitive search term for the filament material. Separate multiple terms with a comma. "
"Specify an empty string to match spools with no filament material."
"Specify an empty string to match spools with no filament material. "
"Surround a term with quotes to search for the exact term."
),
),
filament_vendor_name: Optional[str] = Query(
@@ -197,7 +199,8 @@ async def find(
title="Vendor Name",
description=(
"Partial case-insensitive search term for the filament vendor name. Separate multiple terms with a comma. "
"Specify an empty string to match spools with no vendor name."
"Specify an empty string to match spools with no vendor name. "
"Surround a term with quotes to search for the exact term."
),
),
filament_vendor_id: Optional[str] = Query(
@@ -216,7 +219,8 @@ async def find(
title="Location",
description=(
"Partial case-insensitive search term for the spool location. Separate multiple terms with a comma. "
"Specify an empty string to match spools with no location."
"Specify an empty string to match spools with no location. "
"Surround a term with quotes to search for the exact term."
),
),
lot_nr: Optional[str] = Query(
@@ -224,7 +228,8 @@ async def find(
title="Lot/Batch Number",
description=(
"Partial case-insensitive search term for the spool lot number. Separate multiple terms with a comma. "
"Specify an empty string to match spools with no lot nr."
"Specify an empty string to match spools with no lot nr. "
"Surround a term with quotes to search for the exact term."
),
),
allow_archived: bool = Query(

View File

@@ -83,7 +83,10 @@ async def find(
name: Optional[str] = Query(
default=None,
title="Vendor Name",
description="Partial case-insensitive search term for the vendor name. Separate multiple terms with a comma.",
description=(
"Partial case-insensitive search term for the vendor name. Separate multiple terms with a comma. "
"Surround a term with quotes to search for the exact term."
),
),
external_id: Optional[str] = Query(
default=None,
@@ -91,7 +94,8 @@ async def find(
description=(
"Exact match for the vendor external ID. "
"Separate multiple IDs with a comma. "
"Specify empty string to match filaments with no external ID."
"Specify empty string to match filaments with no external ID. "
"Surround a term with quotes to search for the exact term."
),
),
sort: Optional[str] = Query(