Skip to content

Commit 34cfd07

Browse files
#277 Make running of ViewSet checks flexible to allow dynamic document definition (#278)
1 parent 8fe3526 commit 34cfd07

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,20 @@ are used for versioning (schema follows below):
1515
0.3.4 to 0.4).
1616
- All backwards incompatible changes are mentioned in this document.
1717

18+
0.22.3
19+
------
20+
2022-01-24
21+
22+
- Make running of ViewSet checks flexible (to allow dynamic document definition).
23+
1824
0.22.2
19-
----
25+
------
2026
2021-08-29
2127

2228
- Tested against Django 3.2.
2329

2430
0.22.1
25-
----
31+
------
2632
2021-05-01
2733

2834
- `DictionaryProxy` gets an optional `meta` argument, which will hold meta

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import find_packages, setup
44

5-
version = '0.22.2'
5+
version = '0.22.3'
66

77
DOCS_TRANSFORMATIONS = (
88
(

src/django_elasticsearch_dsl_drf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
__title__ = 'django-elasticsearch-dsl-drf'
6-
__version__ = '0.22.2'
6+
__version__ = '0.22.3'
77
__author__ = 'Artur Barseghyan <[email protected]>'
88
__copyright__ = '2017-2021 Artur Barseghyan'
99
__license__ = 'GPL 2.0/LGPL 2.1'

src/django_elasticsearch_dsl_drf/viewsets.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class BaseDocumentViewSet(ReadOnlyModelViewSet):
154154
ignore = []
155155

156156
def __init__(self, *args, **kwargs):
157-
assert self.document is not None
157+
self.run_checks()
158158

159159
self.client = connections.get_connection(
160160
self.document._get_using()
@@ -168,6 +168,9 @@ def __init__(self, *args, **kwargs):
168168
)
169169
super(BaseDocumentViewSet, self).__init__(*args, **kwargs)
170170

171+
def run_checks(self):
172+
assert self.document is not None
173+
171174
def get_queryset(self):
172175
"""Get queryset."""
173176
queryset = self.search.query()

0 commit comments

Comments
 (0)