File tree Expand file tree Collapse file tree 14 files changed +72
-13
lines changed
src/django_elasticsearch_dsl_drf Expand file tree Collapse file tree 14 files changed +72
-13
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ services:
77 build :
88 context : .
99 dockerfile : ./docker/elasticsearch/Dockerfile
10- image : docker.elastic.co/elasticsearch/elasticsearch:7.5.2
1110 volumes :
1211 - esdata:/usr/share/elasticsearch/data
1312 ports :
Original file line number Diff line number Diff line change 1- FROM docker.io/python:3.6.7 -slim-jessie
1+ FROM docker.io/python:3.9 -slim-bullseye
22ENV PYTHONUNBUFFERED 1
33
44RUN apt-get update
55RUN apt-get install -y build-essential
66RUN apt-get install -y cmake
77RUN apt-get install -y libpq-dev
8- RUN apt-get install -y python-dev
9- RUN apt-get install -y python-pip
10- RUN apt-get install -y python-imaging
8+ # RUN apt-get install -y python-dev
9+ # RUN apt-get install -y python-pip
10+ # RUN apt-get install -y python-imaging
1111RUN apt-get install -y mc
1212RUN apt-get install -y nano
1313
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ simplegeneric==0.8.1
3636 # via ipython
3737six==1.16.0
3838 # via prompt-toolkit
39- traitlets==5.0.5
39+ traitlets==4.3
4040 # via ipython
4141wcwidth==0.2.5
4242 # via prompt-toolkit
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ sqlparse==0.4.1
162162 # django-debug-toolbar
163163toml==0.10.2
164164 # via pylint
165- traitlets==5.0.5
165+ traitlets==4.3
166166 # via ipython
167167urllib3==1.26.6
168168 # via requests
Original file line number Diff line number Diff line change 1+ #
2+ # This file is autogenerated by pip-compile with python 3.9
3+ # To update, run:
4+ #
5+ # pip-compile elastic_docker.in
6+ #
7+ django-elasticsearch-dsl==7.1.1
8+ # via -r elastic_docker.in
9+ elasticsearch==7.5.1
10+ # via
11+ # -r elastic_docker.in
12+ # elasticsearch-dsl
13+ elasticsearch-dsl==7.1.0
14+ # via
15+ # -r elastic_docker.in
16+ # django-elasticsearch-dsl
17+ python-dateutil==2.8.2
18+ # via elasticsearch-dsl
19+ six==1.16.0
20+ # via
21+ # django-elasticsearch-dsl
22+ # elasticsearch-dsl
23+ # python-dateutil
24+ urllib3==1.26.9
25+ # via elasticsearch
Original file line number Diff line number Diff line change 1- from factory import DjangoModelFactory , SubFactory
1+ from factory import SubFactory
2+ from factory .django import DjangoModelFactory
23
34from books .models import Galaxy
45
Original file line number Diff line number Diff line change 1- from factory import DjangoModelFactory , SubFactory
1+ from factory import SubFactory
2+ from factory .django import DjangoModelFactory
23
34from books .models import Planet
45
Original file line number Diff line number Diff line change 1616 BookMoreLikeThisNoOptionsDocumentViewSet ,
1717 BookMultiMatchOptionsPhasePrefixSearchFilterBackendDocumentViewSet ,
1818 BookMultiMatchSearchFilterBackendDocumentViewSet ,
19+ BookNoRecordsDocumentViewSet ,
1920 BookOrderingByScoreCompoundSearchBackendDocumentViewSet ,
2021 BookOrderingByScoreDocumentViewSet ,
2122 BookPermissionsDocumentViewSet ,
8081 BookDocumentViewSet ,
8182 basename = 'bookdocument'
8283)
83-
84+ router .register (
85+ r'books-no-records' ,
86+ BookNoRecordsDocumentViewSet ,
87+ basename = 'bookdocument-no-records'
88+ )
8489router .register (
8590 r'books-query-friendly-pagination' ,
8691 QueryFriendlyPaginationBookDocumentViewSet ,
Original file line number Diff line number Diff line change 1010from .more_like_this import *
1111from .multi_match import *
1212from .multi_match_options_phrase_prefix import *
13+ from .no_records import *
1314from .ordering_by_score import *
1415from .ordering_by_score_compound_search import *
1516from .permissions import *
Original file line number Diff line number Diff line change 1+ from django_elasticsearch_dsl_drf .utils import EmptySearch
2+
3+ from .default import BookDocumentViewSet
4+
5+ __all__ = (
6+ 'BookNoRecordsDocumentViewSet' ,
7+ )
8+
9+
10+ class BookNoRecordsDocumentViewSet (BookDocumentViewSet ):
11+ """Book document view set based on compound search backend."""
12+
13+ def get_queryset (self ):
14+ queryset = EmptySearch ()
15+ queryset .model = self .document .Django .model
16+ return queryset
You can’t perform that action at this time.
0 commit comments