This message isn't going through for some reason... ---------- Forwarded message ---------- From: sosurim kim <sosuri...@gmail.com> Date: Mon, Nov 8, 2010 at 1:55 PM Subject: Re: creating a combined form linked via foreign key?? To: django-users@googlegroups.com
Oops, I meant to say addressbook, not phonebook... sorry. # models.py class Myuser(User): bio = models.TextField() class AddressBook(models.Model): userid = models.ForeignKey(CustomUser, blank=True, null=True) address = models.CharField(max_length=50) city = models.CharField(max_length=50) zip = models.CharField(max_length=20) state = models.CharField(max_length=50) # admin.py from django.contrib import admin from models import * class AddressBookInline(admin.TabularInline): model = AddressBook can_delete = True class CustomUserAdmin(admin.ModelAdmin): inlines = ( AddressBookInline ) fk_name = 'userid' admin.site.register(Myuser, CustomUserAdmin) > > > So when I go into django admin, I see all the fields for Myuser, but > AddressBook fields appear three times. It doesn't matter whether I subclass > StackedInline or TabularInline, I get the AddressBook three times. > > Is there a better way to create a combo form that contains two (or more) > models linked with a foreign key (or manytomany, onetomany, etc.)?? > > Thanks, > > S > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.