Hi,
I'm pretty new to Django soi excuse me if this is a stupid question, but here we go.
I have the following model:
class Motivation(models.Model):
def __unicode__(self): # Python 3: def __str__(self):
return self.score
score = models.CharField(max_length=100)
description = models.CharField(max_length=300)
insert_date = models.DateTimeField(auto_now_add=True) #insert date
update_date = models.DateTimeField(auto_now=True) #last updated date
and another model with a foreign key to the first one:
class PerformanceAnimal(models.Model):
def __unicode__(self): # Python 3: def __str__(self):
return u'%s' % self.animal
training_session = models.ForeignKey('Training')
animal = models.ForeignKey('animals.Animal')
state_of_mind = models.CharField(max_length=200, blank=True)
motivation = models.ForeignKey('behaviour.Motivation')
In the admin panel the foreign key select field shows the score (like it's supposed to), but I would like it to show score, description
How do I go about that?
Thanks for your help.