Re: Re: Default ordering on User model

2010-05-24 Thread Gary Reynolds
You could always use a proxy model instead of monkey patching. class MyUser(User): class Meta: proxy = True ordering = ('first_name', 'last_name') def __unicode__(self): return self.get_full_name() Then in any models you define a FK to User, just FK to MyUser instead. On Fri, May

Re: Default ordering on User model

2010-05-21 Thread Andy McKay
On 2010-05-21, at 6:19 AM, Reinout van Rees wrote: > Another data point: Plone has a checkbox for that: "do you have many > users/groups?". If True, several screens don't attempt to list all users, do > sorting, etc. Instead search fields are used. > > So: best of both worlds. But there's of

Re: Default ordering on User model

2010-05-21 Thread Reinout van Rees
On 05/21/2010 02:59 PM, Karen Tracey wrote: Actually there is no default ordering, and yes, there is a reason, see: http://code.djangoproject.com/ticket/6089, which also shows a workaround for getting ordering back for specific form fields. Granted that is a bit of a pain, and there is some diss

Re: Re: Default ordering on User model

2010-05-21 Thread s . kuzmenko
My favourite workaround for this is to register a small dummy apps overriding default properties: from django.conf import settings if "django.contrib.auth" in settings.INSTALLED_APPS: # modify User model properties only if contrib.auth is installed from django.contrib.auth.models import User #

Re: Default ordering on User model

2010-05-21 Thread Karen Tracey
On Fri, May 21, 2010 at 8:46 AM, Jeremy Dunck wrote: > Even so, you could create a custom ModelAdmin for User, specifying the > ordering option: > > http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#django.contrib.admin.ModelAdmin.ordering > > The default model admin for the User model alre

Re: Default ordering on User model

2010-05-21 Thread Karen Tracey
On Fri, May 21, 2010 at 8:38 AM, tiemonster wrote: > Is there a reason that the default ordering on the User model is by > pk? Would it be a reasonable request to ask that the default ordering > for this model be username? I have several models that have a m2m to > the User model, and it's very h

Re: Default ordering on User model

2010-05-21 Thread Jeremy Dunck
On Fri, May 21, 2010 at 7:38 AM, tiemonster wrote: > Is there a reason that the default ordering on the User model is by > pk? Would it be a reasonable request to ask that the default ordering > for this model be username? I have several models that have a m2m to > the User model, and it's very ha

Default ordering on User model

2010-05-21 Thread tiemonster
Is there a reason that the default ordering on the User model is by pk? Would it be a reasonable request to ask that the default ordering for this model be username? I have several models that have a m2m to the User model, and it's very hard to find someone to add using the admin when the users are