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
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
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
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
#
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
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
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
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