Re: Display ForeignKey label rather than ID in a CharField

2010-11-20 Thread Marcos Moyano
You need to specify the __unicode__ method of the model holding the Fish object. ie: class FishHolder(models.Model): name = models.CharField(...) . def __unicode__(self): return self.name That should display the names instead of the ids. Rgds, Marcos On Fri, Nov 19, 2010

Display ForeignKey label rather than ID in a CharField

2010-11-19 Thread Jamie Pittock
I have to override the default display of a foreignkey field in a form and instead display it as a CharField. Currently it displays the selection's ID but I need to display the label instead To be clear, the select option would be the default display for the ForeignKey. At the moment after I've