From 5662a040b9e47eb2bcc6f9d33950ce710c05cf4d Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Tue, 25 Jun 2019 17:02:21 +0100 Subject: [PATCH] Update docs to include `__all__` option --- docs/queries.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/queries.rst b/docs/queries.rst index 12071cf..862dd32 100644 --- a/docs/queries.rst +++ b/docs/queries.rst @@ -63,6 +63,17 @@ Show **only** these fields on the model: model = Question fields = ('id', 'question_text') +You can also set the ``fields`` attribute to the special value ``'__all__'`` to indicate that all fields in the model should be used. + +For example: + +.. code:: python + + class QuestionType(DjangoObjectType): + class Meta: + model = Question + fields = '__all__' + ``exclude`` ~~~~~~~~~~~