#10274 closed (fixed)
BaseGenericInlineFormSet.get_queryset calls .empty()
Reported by: | Owned by: | Brian Rosner | |
---|---|---|---|
Component: | Contrib apps | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Pull Requests: | How to create a pull request | ||
Description ¶
In BaseGenericInlineFormSet.get_queryset():
if self.instance is None: return self.model._default_manager.empty()
Managers don't have an empty()
method; this should instead be get_empty_query_set()
. Attached patch (against trunk revision 9836) includes a doctest to illustrate the problem.
Change History (6)
by , 16 years ago
Attachment: | BaseGenericInlineFormSet.diff added |
---|
comment:1 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Triage Stage: | Unreviewed → Accepted |
by , 16 years ago
Attachment: | 10274-generic-inline-formset-patch-and-test.diff added |
---|
patch and tests with none() instead of empty()
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 16 years ago
Note:
See TracTickets
for help on using tickets.
Wow, that must have been a brain dead commit by me. You are correct
empty()
is not on a manager, butnone()
would have been correct here. Thanks for the patch!