Sort methods. Update use of .filter_by_access() to .restrict_queryset(). Change the method to so the final object filtering. Instead of expressing the pk list and remove the duplicated using a set, pass the queryset as a subquery to the object filter. This moves the processing to the database instead of holding a list of an unknown number of primary keys in the memory. Add keyword arguments. Update tests to use the latest user test case mixin interface. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
from __future__ import unicode_literals
|
|
|
|
from django.conf.urls import url
|
|
|
|
from .api_views import APIAdvancedSearchView, APISearchModelList, APISearchView
|
|
from .views import AdvancedSearchView, ResultsView, SearchAgainView, SearchView
|
|
|
|
urlpatterns = [
|
|
url(
|
|
regex=r'^(?P<search_model>[\.\w]+)/$', name='search',
|
|
view=SearchView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^advanced/(?P<search_model>[\.\w]+)/$', name='search_advanced',
|
|
view=AdvancedSearchView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^again/(?P<search_model>[\.\w]+)/$', name='search_again',
|
|
view=SearchAgainView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^results/(?P<search_model>[\.\w]+)/$', name='results',
|
|
view=ResultsView.as_view()
|
|
)
|
|
]
|
|
|
|
api_urls = [
|
|
url(
|
|
regex=r'^search_models/$', name='searchmodel-list',
|
|
view=APISearchModelList.as_view()
|
|
),
|
|
url(
|
|
regex=r'^search/(?P<search_model>[\.\w]+)/$', name='search-view',
|
|
view=APISearchView.as_view()
|
|
),
|
|
url(
|
|
regex=r'^search/advanced/(?P<search_model>[\.\w]+)/$',
|
|
name='advanced-search-view', view=APIAdvancedSearchView.as_view()
|
|
),
|
|
]
|