[Solved]-Django – model unicode() show foreignkey object attribute

13👍

You can indeed, by referring to the attribute using the ‘dot’ syntax.
Here is what you want:

def __unicode__(self):
   return '%s %s' % (self.app_id.app_name, self.environ_name)     

Leave a comment