Django

Code

Ticket #6089 (closed: fixed)

Opened 9 months ago

Last modified 2 months ago

Remove ordering for contrib.auth User model

Reported by: leahculver Assigned to: ekarulf
Milestone: Component: Contrib apps
Version: SVN Keywords:
Cc: erik@karulf.com, lau@iola.dk, spacetaxi@gmail.com Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

In contrib.auth the User model has:

ordering = ('username',)

While it is very nice for small applications to have pretty ordered output, it's a bit hard on applications with many users (such as pownce.com). One concern is there might be applications that depend on this ordering in the User model and it would be nice not to break this functionality. However, it might be worth doing to make Django "scale"... ugh.

Attachments

unordered-auth.diff (0.6 kB) - added by ekarulf on 12/01/07 18:09:25.
Removed ordering by default from User and Group
unordered-auth-2.diff (1.0 kB) - added by ekarulf on 12/01/07 18:56:31.
Same as above with added ordering in admin

Change History

12/01/07 18:08:00 changed by ekarulf

  • cc set to erik@karulf.com.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.
  • has_patch set to 1.
  • stage changed from Unreviewed to Design decision needed.

I'm a strong +1 on this as well. I'll submit the small 2 line patch, though it defiantly needs a design decision.

12/01/07 18:09:25 changed by ekarulf

  • attachment unordered-auth.diff added.

Removed ordering by default from User and Group

12/01/07 18:47:13 changed by jacob

  • stage changed from Design decision needed to Accepted.

Accepted, with the comments I told ekarulf IRL.

12/01/07 18:56:31 changed by ekarulf

  • attachment unordered-auth-2.diff added.

Same as above with added ordering in admin

04/13/08 13:13:44 changed by anonymous

  • cc changed from erik@karulf.com to erik@karulf.com, lau@iola.dk.

06/10/08 13:40:44 changed by ekarulf

  • owner changed from nobody to ekarulf.
  • status changed from new to assigned.
  • stage changed from Accepted to Ready for checkin.

I bumped into this again when migrating a large table of users into Django.

The patch seems fairly benign, ready for checkin?

(follow-up: ↓ 6 ) 06/30/08 07:52:46 changed by mtredinnick

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [7806]) Fixed #6089 -- Removed default ordering on the User class. Admin users are still ordered, since we add it in specially for Admin. Slightly backwards incompatible.

Patch from Erik Karulf.

(in reply to: ↑ 5 ) 07/07/08 07:11:55 changed by spacetaxi

I have a model with a many-to-many relation to the contrib.auth User model. Now when I open the admin form (newforms-admin) to edit my model, the user-selection widget contains unsorted users... This is nearly unusable. Prior to [7806] the selection widget was sorted. I need this widget to show sorted users, but what's the right way to get them sorted again? (Maybe this is dumb question, but currently I don't see an elegant solution...)

07/07/08 07:34:59 changed by spacetaxi

  • cc changed from erik@karulf.com, lau@iola.dk to erik@karulf.com, lau@iola.dk, spacetaxi@gmail.com.

Add/Change #6089 (Remove ordering for contrib.auth User model)




Change Properties
Action