(self, *names, **names_and_args)
Select fields of a container type.

        This is a helper to automate selection of fields of container
        types, such as giving a list of names to include, with or
        without parameters (passed as a mapping ``name=args``).

        If no arguments are given, all fields are included.

        If the keyword argument ``__exclude__`` is given a list of
        names, then all but those fields will be
        included. Alternatively one can exclude fields using
        ``name=None`` or ``name=False`` as keyword argument.

        If a list of names is given as positional arguments, then only
        those names will be included. Alternatively one can include
        fields using ``name=True``. To include fields with selection
        parameters, then use ``name=dict(...)`` or ``name=list(...)``.
        To include fields without arguments and with aliases, use the
        shortcut ``name='alias'``.

        The special built-in field ``__typename`` is not selected by default.
        In order to select it, provide ``__typename__=True`` as a parameter.

        .. code-block:: python

          # just field1 and field2
          parent.field.child.__fields__('field1', 'field2')
          parent.field.child.__fields__(field1=True, field2=True)

          # field1 with parameters
          parent.field.child.__fields__(field1=dict(param1='value1'))

          # field1 renamed (aliased) to alias1
          parent.field.child.__fields__(field1='alias1')

          # all but field2
          parent.field.child.__fields__(field2=False)
          parent.field.child.__fields__(field2=None)
          parent.field.child.__fields__(__exclude__=('field2',))

          # all and also include __typename
          parent.field.child.__fields__(__typename__=True)
          parent.field.child.__fields__('__typename__')
Select fields of a container type.
Select fields of a container type .
def __fields__(self, *names, **names_and_args):
        '''Select fields of a container type.

        This is a helper to automate selection of fields of container
        types, such as giving a list of names to include, with or
        without parameters (passed as a mapping ``name=args``).

        If no arguments are given, all fields are included.

        If the keyword argument ``__exclude__`` is given a list of
        names, then all but those fields will be
        included. Alternatively one can exclude fields using
        ``name=None`` or ``name=False`` as keyword argument.

        If a list of names is given as positional arguments, then only
        those names will be included. Alternatively one can include
        fields using ``name=True``. To include fields with selection
        parameters, then use ``name=dict(...)`` or ``name=list(...)``.
        To include fields without arguments and with aliases, use the
        shortcut ``name='alias'``.

        The special built-in field ``__typename`` is not selected by default.
        In order to select it, provide ``__typename__=True`` as a parameter.

        .. code-block:: python

          # just field1 and field2
          parent.field.child.__fields__('field1', 'field2')
          parent.field.child.__fields__(field1=True, field2=True)

          # field1 with parameters
          parent.field.child.__fields__(field1=dict(param1='value1'))

          # field1 renamed (aliased) to alias1
          parent.field.child.__fields__(field1='alias1')

          # all but field2
          parent.field.child.__fields__(field2=False)
          parent.field.child.__fields__(field2=None)
          parent.field.child.__fields__(__exclude__=('field2',))

          # all and also include __typename
          parent.field.child.__fields__(__typename__=True)
          parent.field.child.__fields__('__typename__')
        '''
        names = list(names)
        exclude = self.__fields_gen_excludes(names_and_args)
        typename = self.__fields_has_typename(names, names_and_args, exclude)
        if typename:
            self['__typename__']()

        if not names and not names_and_args:
            self.__fields_add_all(exclude, typename)
            return

        self.__fields_add_names(names, typename)
        self.__fields_add_names_and_args(names_and_args, typename)
def __fields__ ( self , * names , * * names_and_args ) : names = list ( names ) exclude = self . __fields_gen_excludes ( names_and_args ) typename = self . __fields_has_typename ( names , names_and_args , exclude ) if typename : self [ '__typename__' ] ( ) if not names and not names_and_args : self . __fields_add_all ( exclude , typename ) return self . __fields_add_names ( names , typename ) self . __fields_add_names_and_args ( names_and_args , typename )