Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#12340 closed (fixed)

`BaseGenericInlineFormSet.get_queryset` returns an unordered queryset

Reported by: jbronn Owned by: jbronn
Component: Contrib apps Version: dev
Severity: Keywords: generic inline
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The parent class, BaseModelFormSet, [source:django/trunk/django/forms/models.py@11688#L481 orders the queryset it returns], and so should BaseGenericInline. An important reason to do this is that BaseFormSet._construct_form uses [source:django/trunk/django/forms/models.py@11688#L478 queryset slicing] at an integer index, and if the QuerySet returned is unordered, then it's possible to get the same model for a different integer index.

Attachments (1)

generic_inline_order_qs_v1.diff (882 bytes ) - added by jbronn 15 years ago.
Orders the queryset.

Download all attachments as: .zip

Change History (4)

by jbronn, 15 years ago

Orders the queryset.

comment:1 by jbronn, 15 years ago

Resolution: fixed
Status: newclosed

(In [11800]) Fixed #12340 -- BaseGenericInlineFormSet.get_queryset now returns an ordered queryset.

comment:2 by jbronn, 15 years ago

(In [11801]) [1.1.X] Fixed #12340 -- BaseGenericInlineFormSet.get_queryset now returns an ordered queryset.

Backport of r11800 from trunk.

comment:3 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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