I have a 1.7 app, and in admin when I reference a foreign key field, instead of showing the values in the drop down, it shows "`model name` object":
This does not happen in 1.5 (in a different app).
Here are my models:
class IPGroups(models.Model):
groupName = models.CharField(max_length=20)
class AllowedIPs(models.Model):
ip = models.CharField(max_length=15)
group = models.ForeignKey(IPGroups)
Here is my admin code:
class IPGroupsAdmin(admin.ModelAdmin):
list_display = ('groupName',)
list_filter = ('groupName',)
admin.site.register(IPGroups, IPGroupsAdmin)
class AllowedIPsAdmin(admin.ModelAdmin):
list_display = ('ip', 'group')
list_filter = ('ip', 'group')
admin.site.register(AllowedIPs, AllowedIPsAdmin)
How can I get it show the values from the IPGroups table? I'm sure I'm doing something simple and stupid wrong, but I can't see it.
Thanks!