Loading rpc/methods.py +17 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import os import re from glob import glob as _glob import unidecode from django.utils.timezone import now as _now from functools import wraps as _wraps from rpc.const import * Loading Loading @@ -971,7 +973,11 @@ def advanced_search_terms(user: User) -> List[str]: @_rpc_groups(["Search"]) def advanced_search( user: User, search_terms: List[Dict], project_id: int, include_metas: bool = False user: User, search_terms: List[Dict], project_id: int, include_metas: bool = False, collection_id: int = None, ) -> Dict[str, List]: """ Performs a complex search using terms such as 'contains', 'is', 'does_not_contain'. Loading @@ -984,6 +990,7 @@ def advanced_search( [ {"property": "title", "term": "contains", "value": "cherbourg"}, {"meta": 123, "term": "is", "value": "35mm"}, {"exclude_meta": 145}, {"tags": ["PAINTINGS", "PHOTOS"]} {"exclude_tags": ["DRAWINGS"]} ] Loading Loading @@ -1016,10 +1023,14 @@ def advanced_search( _check_project_permission(user, project, PERM_RESOURCE_READ) # TODO: add tags search results = {"collections": [], "resources": []} # Search Resources first resources_set = Resource.objects.filter( ptr_project=project, deleted_at__isnull=True ) if collection_id: resources_set = resources_set.filter(collection_id=collection_id) for search_term in search_terms: if ( "property" in search_term Loading Loading @@ -1074,6 +1085,10 @@ def advanced_search( collections_set = Collection.objects.filter( project=project, deleted_at__isnull=True ) if collection_id: collections_set = collections_set.filter(parent_id=collection_id) for search_term in search_terms: if ( "property" in search_term Loading Loading @@ -2307,6 +2322,6 @@ def collection_stats(user: User, collection_id: int) -> dict: @_rpc_groups(["Utilities"]) def recycle_bin(user: User, project_id: int) -> List[Dict]: """ Recycle bin Gets deleted elements """ pass Loading
rpc/methods.py +17 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,8 @@ import os import re from glob import glob as _glob import unidecode from django.utils.timezone import now as _now from functools import wraps as _wraps from rpc.const import * Loading Loading @@ -971,7 +973,11 @@ def advanced_search_terms(user: User) -> List[str]: @_rpc_groups(["Search"]) def advanced_search( user: User, search_terms: List[Dict], project_id: int, include_metas: bool = False user: User, search_terms: List[Dict], project_id: int, include_metas: bool = False, collection_id: int = None, ) -> Dict[str, List]: """ Performs a complex search using terms such as 'contains', 'is', 'does_not_contain'. Loading @@ -984,6 +990,7 @@ def advanced_search( [ {"property": "title", "term": "contains", "value": "cherbourg"}, {"meta": 123, "term": "is", "value": "35mm"}, {"exclude_meta": 145}, {"tags": ["PAINTINGS", "PHOTOS"]} {"exclude_tags": ["DRAWINGS"]} ] Loading Loading @@ -1016,10 +1023,14 @@ def advanced_search( _check_project_permission(user, project, PERM_RESOURCE_READ) # TODO: add tags search results = {"collections": [], "resources": []} # Search Resources first resources_set = Resource.objects.filter( ptr_project=project, deleted_at__isnull=True ) if collection_id: resources_set = resources_set.filter(collection_id=collection_id) for search_term in search_terms: if ( "property" in search_term Loading Loading @@ -1074,6 +1085,10 @@ def advanced_search( collections_set = Collection.objects.filter( project=project, deleted_at__isnull=True ) if collection_id: collections_set = collections_set.filter(parent_id=collection_id) for search_term in search_terms: if ( "property" in search_term Loading Loading @@ -2307,6 +2322,6 @@ def collection_stats(user: User, collection_id: int) -> dict: @_rpc_groups(["Utilities"]) def recycle_bin(user: User, project_id: int) -> List[Dict]: """ Recycle bin Gets deleted elements """ pass