Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #35401 -- Documented the conditional page decorator. #18150

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lufafajoshua
Copy link
Contributor

Mentioned the use of the conditional page decorator to provide functionality for Conditional for
ConditionalGetMiddleware on individual views, also mentioned the use of csrf_protect decorator to add protection of CsrfViewMiddleware to a view.

Trac ticket number

ticket-35401

Branch description

Provide a concise overview of the issue or rationale behind the proposed changes.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

Mentioned the use of the conditional page decorator to
provide functionality for Conditional for
ConditionalGetMiddleware on individual views, also
mentioned the use of csrf_protect decorator to add
protection of CsrfViewMiddleware to a view.
Copy link
Contributor

@sarahboyce sarahboyce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lufafajoshua ⭐ I have some small comments

docs/ref/middleware.txt Outdated Show resolved Hide resolved
@@ -71,6 +71,11 @@ a :class:`django.http.HttpResponseNotAllowed` if the conditions are not met.

Support for wrapping asynchronous view functions was added.

.. function:: conditional_page()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be defined in the Conditional view processing section below rather than this section.
There is also a Conditional View Processing topic docs/topics/conditional-view-processing.txt, I'm wondering if this should be described over there too 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @sarahboyce , I was thinking a link to Conditional GET middleware in Comparing conditional processing would be enough to guide someone to the conditional page decorator.

lufafajoshua and others added 2 commits May 21, 2024 10:49
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
Moved documentation on conditional page decorator to Conditional view processing section.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants