Wiadomość napisana w dniu 2008-10-02, o godz. 09:11, przez James Bennett:
>> Anyway, I seem to be unable to change ordering of FKs relating to >> User >> object. Any hint? > > class UserProfileForm(forms.ModelForm): > user = > forms.ModelChoiceField(queryset=User.objects.order_by('username')) > > class Meta: > model = UserProfile > > > class UserProfileAdmin(admin.ModelAdmin): > form = UserProfileForm > > admin.site.register(UserProfile, UserProfileAdmin) > > There are other ways to come at this if you just want to override a > single field, but I'm a fan of just doing the form. Ouch, that was obvious. :) Thank you. -- We read Knuth so you don't have to. - Tim Peters Jarek Zgoda, R&D, Redefine [EMAIL PROTECTED] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---