diff --git a/docs/filtering.rst b/docs/filtering.rst index f2ea0e1f0..f6ad8828f 100644 --- a/docs/filtering.rst +++ b/docs/filtering.rst @@ -91,50 +91,13 @@ Which you could query as follows: } } -Orderable fields ----------------- - -Ordering can also be specified using ``filter_order_by``. Like -``filter_fields``, this value is also passed directly to -``django-filter`` as the ``order_by`` field. For full details see the -`order\_by -documentation `__. - -For example: - -.. code:: python - - class AnimalNode(DjangoObjectType): - class Meta: - model = Animal - filter_fields = ['name', 'genus', 'is_domesticated'] - # Either a tuple/list of fields upon which ordering is allowed, or - # True to allow filtering on all fields specified in filter_fields - filter_order_by = True - interfaces = (relay.Node, ) - -You can then control the ordering via the ``orderBy`` argument: - -.. code:: - - query { - allAnimals(orderBy: "name") { - edges { - node { - id, - name - } - } - } - } - Custom Filtersets ----------------- By default Graphene provides easy access to the most commonly used features of ``django-filter``. This is done by transparently creating a ``django_filters.FilterSet`` class for you and passing in the values for -``filter_fields`` and ``filter_order_by``. +``filter_fields``. However, you may find this to be insufficient. In these cases you can create your own ``Filterset`` as follows: diff --git a/docs/tutorial.rst b/docs/tutorial.rst index e1537a335..cd201b9c0 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -98,7 +98,6 @@ Create ``cookbook/ingredients/schema.py`` and type the following: class Meta: model = Category filter_fields = ['name', 'ingredients'] - filter_order_by = ['name'] interfaces = (relay.Node, ) @@ -112,7 +111,6 @@ Create ``cookbook/ingredients/schema.py`` and type the following: 'category': ['exact'], 'category__name': ['exact'], } - filter_order_by = ['name', 'category__name'] interfaces = (relay.Node, )