I have a basic model that extends the User model:
from django.contrib.auth.models import User
class Promotion (models.Model):
User = models.ForeignKey(User)
Rating = models.ForeignKey(Rating)
Date_Effective = models.DateField()
def __str__(self):
return self.Rating.Rank.Short_Rank + ' ' + self.User.last_name + ' (' + str(self.Date_Effective) + ')'
in my Admin.py, i have the models showing:
admin.site.register(models.Promotion)
when loading a promotion, the Short_Rank
field and the Date_Effective
fields show perfectly, but the User.last_name
does not.
ADM (2017-03-18)
This is consistent with the rest of the models, and I am believing that the User model itself is not being attacked by the query in the admin panel. How do I get the name fields in the User model showing in the model page of the Admin panel? Thanks.