Using the newforms-admin branch, you there are queryset hooks to aid in this. Not tested, but you should be able to do something like this in your model's admin class:
class SomethingModelAdmin(admin.ModelAdmin): def queryset_change(self, request): return super(SomethingModelAdmin, self).queryset_change(request).sort_by( [ your sort conditions ] Dan On Dec 30 2007, 6:51 pm, marcus <[EMAIL PROTECTED]> wrote: > hi, i'm having two tables which look something like... > > class Company(models.Model): > name = models.CharField(max_length = 128) > > class Something(models.Model): > someField = models.CharField(max_length = 128) > company = models.ForeignKey(Company) > > in the company table rows are like > > 1 Jaguar > 2 BMW > 3 Alpha-Romeo > ... > > And when I want to edit 'Something' on the admin site then the > companies also appear in this order within the select element. Is it > possible to change this? > > Thanks, Marcus --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---