Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-08 Thread Eiji Kobayashi
On Sun, May 8, 2011 at 12:00 AM, Oleg Lomaka wrote: > You have started from the beginning. Take a look at my very first reply in > this thread. Remove 'areacode' and 'number' fields from your MemberAdmin. > Let them be available from PhoneInline and AddressInline. You will

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-08 Thread Oleg Lomaka
You have started from the beginning. Take a look at my very first reply in this thread. Remove 'areacode' and 'number' fields from your MemberAdmin. Let them be available from PhoneInline and AddressInline. You will be see them on the same admin page, just in other visual block where inline forms

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
Hi Oleg, Thanks for your patience. I'm pretty sure I DID miss something like you said. Here's my admin.py, with the modifications you suggested: # admin.py from django.contrib import admin from django.contrib.auth.models import User from models import Member, Address, Phone class

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Oleg Lomaka
If you get the same error, the you have missed something. Show me your current admin.py once more. As to "I'd like to be able to access the fields from the Phone and Address model from the MemberAdmin model". You can access fields from Phone and Address from the InlineAdminModel. That is in case

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
This doesn't do anything. I still get the same error. I'd like to be able to access the fields from the Phone and Address model from the MemberAdmin model. I still cannot do this. Any other way? Eiji On May 7, 7:22 am, Oleg Lomaka wrote: > Move fields from ModelAdmin to

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Oleg Lomaka
Move fields from ModelAdmin to appropriate InlineModelAdmin #admin.py from models import Member, Address, Phone class PhoneInline(admin.StackedInline): model = Phone can_delete = True extra = 0 fields = ('areacode', 'number') class AddressInline(admin.StackedInline): model =

Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
Hi! I'm having trouble figuring out what to do. I have multiple models linked together using foreignkey, like the following: # models.py class Member(User): middle_name = models.CharField(max_length=20) class Phone(models.Model): owner = models.ForeignKey(Member) areacode =