Skip to content

Commit 5e52bc6

Browse files
Merge pull request #201 from michaelwood/allow_all_in_fields
Allow __all__ to be specified as fields in DocumentSerializer
2 parents b289a62 + dd7b59a commit 5e52bc6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/django_elasticsearch_dsl_drf/serializers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ def get_fields(self):
197197
declared_fields = copy.deepcopy(self._declared_fields)
198198
field_mapping = OrderedDict()
199199

200+
# Match drf convention of specifying "__all__" for all available fields
201+
# This is the existing behavior so we can ignore this value.
202+
if __fields == "__all__":
203+
__fields = None
204+
200205
for field_name, field_type in six.iteritems(document_fields):
201206
orig_name = field_name[:]
202207

0 commit comments

Comments
 (0)