"the PhoneBook fields appear three times" Three is the default, but you can set the number of linked (inline) forms for the children: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin.extra
On Nov 8, 11:55 pm, sosurim kim <sosuri...@gmail.com> wrote: > 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.