Refactor dynamic search app API

Convert the API to use viewsets.

The search function is now a service of the search model
resource.

The simple and advance search are now the same service. The
difference is determined by the URL query. A ?q= means a
simple search. For advanced search pass the search model
fields in the URL query, example: ?q=document_type__label=

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-02-23 05:08:39 -04:00
parent 23d56c3147
commit 8599d69d23
7 changed files with 120 additions and 122 deletions
+2 -2
View File
@@ -84,9 +84,9 @@ class SearchModel(object):
return cls._registry
@classmethod
def get(cls, full_name):
def get(cls, name):
try:
result = cls._registry[full_name]
result = cls._registry[name]
except KeyError:
raise KeyError(_('No search model matching the query'))
if not hasattr(result, 'serializer'):