Skip to content

Commit

Permalink
Fixed #35401 -- Documented the conditional_page() decorator.
Browse files Browse the repository at this point in the history
  • Loading branch information
lufafajoshua authored and sarahboyce committed Jun 12, 2024
1 parent 708b01c commit e242829
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/ref/middleware.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ header, the middleware adds one if needed. If the response has an ``ETag`` or
``If-Modified-Since``, the response is replaced by an
:class:`~django.http.HttpResponseNotModified`.

You can handle conditional GET operations with individual views using the
:func:`~django.views.decorators.http.conditional_page()` decorator.

Locale middleware
-----------------

Expand Down
5 changes: 5 additions & 0 deletions docs/topics/http/decorators.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ control caching behavior on particular views.

.. function:: condition(etag_func=None, last_modified_func=None)

.. function:: conditional_page()

This decorator provides the conditional GET operation handling of
:class:`~django.middleware.http.ConditionalGetMiddleware` to a view.

.. function:: etag(etag_func)

.. function:: last_modified(last_modified_func)
Expand Down

0 comments on commit e242829

Please sign in to comment.