Re: ordering ForeignKeys

2008-01-06 Thread marcus
Just seen your answers. Thanks a lot. --~--~-~--~~~---~--~~ 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

Re: ordering ForeignKeys

2008-01-01 Thread Daniel
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,

Re: ordering ForeignKeys

2008-01-01 Thread hedronist
> 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? Good question! I don't have the One true Answer, but I do have a hack. WARNING: The following is a vile and despicable hack!

ordering ForeignKeys

2007-12-30 Thread marcus
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