Re: ModelChoiceField option values

2008-06-10 Thread Mihai Damian
10x, I eventualy solved the problem. I think I was doing some caching and so the values didn't resemble the id's I was reading from the database --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: ModelChoiceField option values

2008-06-09 Thread Adi
The text displayed in the drop down comes from the __str__ method of the referenced model. So, just implement the __str__ method in the model that your ModelChoiceField references, and the display will show you that. On Jun 7, 10:55 am, Mihai Damian <[EMAIL PROTECTED]> wrote: > I'm using a ModelC

ModelChoiceField option values

2008-06-07 Thread Mihai Damian
I'm using a ModelChoiceField on a form and it seems the value attributes of the generated option tags are simply their numeric order in the queryset. How can I set the value attribute to some useful information like id or the __unicode__ representation itself? Thanks --~--~-~--~~-