File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,27 +25,18 @@ def read_items(
2525 if current_user .is_superuser :
2626 query = select (Item )
2727 count_statement = select (func .count ()).select_from (Item )
28- statement = select (Item ).offset (skip ).limit (limit )
2928 else :
3029 query = select (Item ).where (Item .owner_id == current_user .id )
3130 count_statement = (
3231 select (func .count ())
3332 .select_from (Item )
3433 .where (Item .owner_id == current_user .id )
3534 )
36-
37- statement = (
38- select (Item )
39- .where (Item .owner_id == current_user .id )
40- .offset (skip )
41- .limit (limit )
42- )
43-
44-
35+
4536 if search :
4637 search_filter = or_ (
47- Item .title .contains (search , autoescape = True ), # type: ignore
48- Item .description .contains (search , autoescape = True ), # type: ignore
38+ Item .title .contains (search , autoescape = True ), # type: ignore
39+ Item .description .contains (search , autoescape = True ), # type: ignore
4940 )
5041 query = query .where (search_filter )
5142 count_statement = count_statement .where (search_filter )
You can’t perform that action at this time.
0 commit comments