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":

[image: Inline image 2]
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!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY42HrMRhoX-9xvBDfU5BrvKxSwnrKZTfAApKkOgQGsnWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to