Opened 5 months ago

Last modified 5 months ago

#35547 closed Cleanup/optimization

reset_queries not included in __all__ of django/db/__init__.py — at Version 8

Reported by: AjmalPonneth Owned by: AjmalPonneth
Component: Database layer (models, ORM) Version: 5.0
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Sarah Boyce)

Currently, the reset_queries method cannot be imported via from django.db import *.

Change History (8)

comment:2 by Sarah Boyce, 5 months ago

Triage Stage: UnreviewedAccepted

Thank you, this is documented and so we should be able to import 👍

comment:3 by Sarah Boyce, 5 months ago

Has patch: set
Patch needs improvement: set

comment:4 by Sarah Boyce, 5 months ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham, 5 months ago

I think the summary is slightly misleading. It can be imported with from django.db import reset_queries but not with from django.db import *, right?

comment:6 by AjmalPonneth, 5 months ago

Currently, the reset_queries function is not importable from django.db. Since it's not included in the __all__ from django.db.

in reply to:  6 comment:7 by Mariusz Felisiak, 5 months ago

Replying to AjmalPonneth:

Currently, the reset_queries function is not importable from django.db. Since it's not included in the __all__ from django.db.

That's not true. reset_queries can be imported from django.db even without including it in __all__, e.g. https://github.com/django/django/blob/7ba2a0db20c37a5b1500434ca4ed48022311c171/django/test/utils.py#L25.

in reply to:  5 comment:8 by Sarah Boyce, 5 months ago

Description: modified (diff)
Summary: reset_queries cannot be imported from django.dbreset_queries not included in __all__ of django/db/__init__.py

Replying to Tim Graham:

I think the summary is slightly misleading. It can be imported with from django.db import reset_queries but not with from django.db import *, right?

Yes, it's misleading 👍

Note: See TracTickets for help on using tickets.
Back to Top