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 #35392 -- Allowed importing aprefetch_related_objects from django.db.models. #18091

Merged
merged 1 commit into from Apr 22, 2024

Conversation

jlost
Copy link
Contributor

@jlost jlost commented Apr 19, 2024

Trac ticket number

ticket-35392

Branch description

aprefetch_related_objects cannot be imported from django.db.models like prefetch_related_objects can. Because the docs say nothing about importing the async version from a different place, I believe this to be an oversight.

You can work around this by importing from django.db.models.query but if that's the intended behavior, the documentation should be updated to reflect that. Let me know and I'll do so happily!

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.
  • For UI changes, I have attached screenshots in both light and dark modes.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hello! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

@jlost jlost force-pushed the import-aprefetch-rel-objs branch 3 times, most recently from 2ba7808 to ff3f202 Compare April 20, 2024 01:07
@jlost jlost marked this pull request as ready for review April 20, 2024 01:08
@timgraham timgraham changed the title Add aprefetch_related_objects import to django.db.models Fixed #35392 -- Allowed importing aprefetch_related_objects from django.db.models. Apr 20, 2024
docs/releases/5.0.5.txt Outdated Show resolved Hide resolved
Copy link
Member

@felixxm felixxm left a comment

Choose a reason for hiding this comment

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

@jlost Thanks 👍 Welcome aboard ⛵

…cts from django.db.models.

Thanks James Ostrander for the report and fix, and to Tim Graham and
Mariusz Felisiak for the reviews.
@nessita nessita merged commit 36b7024 into django:main Apr 22, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants