Update docs to include __all__ option

This commit is contained in:
Jonathan Kim 2019-06-25 17:02:21 +01:00
parent 4c10afba88
commit 5662a040b9

View File

@ -63,6 +63,17 @@ Show **only** these fields on the model:
model = Question model = Question
fields = ('id', 'question_text') 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`` ``exclude``
~~~~~~~~~~~ ~~~~~~~~~~~