I have two models in my Django app file models.py like so:
class User(models.Model):
user = models.IntegerField(primary_key=True,max_length=5)
first_name = models.CharField(max_length=35)
last_name = models.CharField(max_length=35)
class Device(models.Model):
device_name = models.CharField(unique=True,max_length=30)
user = models.ForeignKey('User')
Each Device can only have one User, but each User can have more than one Device.
In the admin interface, when I display a Device it shows the User in a drop-down list, but when I display the User, I don’t see the associated Device. How do I fix this so I can see the relationship from either side?
You need to use InlineModelAdmin objects
UPD
Should look like: