From 602e1f9de1d5636fb118b92811761447daed21cc Mon Sep 17 00:00:00 2001 From: BossGrand Date: Mon, 6 Feb 2017 16:59:13 -0800 Subject: [PATCH] Added documentation for exclude_fields as a method of limiting field access DjangoObjectType --- docs/authorization.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/authorization.rst b/docs/authorization.rst index 9ee7d0a..31bfdcf 100644 --- a/docs/authorization.rst +++ b/docs/authorization.rst @@ -34,6 +34,20 @@ This is easy, simply use the ``only_fields`` meta attribute. only_fields = ('title', 'content') interfaces = (relay.Node, ) +conversely you can use ``exclude_fields`` meta atrribute + +.. code:: python + + from graphene import relay + from graphene_django.types import DjangoObjectType + from .models import Post + + class PostNode(DjangoObjectType): + class Meta: + model = Post + exclude_fields = ('published', 'owner') + interfaces = (relay.Node, ) + Queryset Filtering On Lists ---------------------------