Yes, you understood my problem. Thanks. That helped.
I tried both suggestions. Your second suggestion looked a little
easier. So, I tried it first. I couldn't get it to work. I assume I
wasn't doing something just right. But, I was able to get your first
solution to work with little fuss.
I'm not sure I understood correctly what you wanted to achieve, but if
you want to order the
Persons in the dropdown for the players field by name, you need to
change the order of the queryset
associated with that field.
For a ForeignKey field, a ModelForm generates a ModelChoiceField
http://docs.
That still doesn't work. In fact, no matter which column I select, I
still get the same order. This is my current code:
101 class Rotation(models.Model):
102 player = models.ForeignKey(Person, to_field='f_name',
verbose_name='Player', limit_choices_to={'relationship' : 'Player'})
103 da
On Apr 20, 4:09 pm, darren wrote:
> I am not able to figure out how to order the records that fill the
> drop down list in a model form. On line 112 below, I have attempted
> to order the Rotation model by player. But, the drop down list that
> is created for me is not ordered that way. I also
I am not able to figure out how to order the records that fill the
drop down list in a model form. On line 112 below, I have attempted
to order the Rotation model by player. But, the drop down list that
is created for me is not ordered that way. I also tried relocating
line 112 to within the Met
5 matches
Mail list logo