List Info

Thread: How do you add the edit of another object from another object's admin view




How do you add the edit of another object from another object's admin view
user name
2007-12-17 12:34:47
Dear all,

I have two object :

1. contacts
2. phone number

contacts and phone number is linked via a primary key
foreign key
connection with the primary key in contacts. The way the
admin
interface is done now is that the contact object has an add
function
and the contacts too has an add function. My question is
instead of
having the phone object seperate can i add the adding of
phone numbers
from the contacts admin form ?

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: How do you add the edit of another object from another object's admin view
country flaguser name
United States
2007-12-17 20:51:55
On 2007-12-17 11:34:47 -0700, "django.lowgmail.com" 
<django.lowgmail.com> said:

> 
> Dear all,
> 
> I have two object :
> 
> 1. contacts
> 2. phone number
> 
> contacts and phone number is linked via a primary key
foreign key
> connection with the primary key in contacts. The way
the admin
> interface is done now is that the contact object has an
add function
> and the contacts too has an add function. My question
is instead of
> having the phone object seperate can i add the adding
of phone numbers
> from the contacts admin form ?

Yes, you can. This is called edit_inline in Django. Check
out [1] and 
read that section. It will show you how to accomplish
edit_inline.

[1]: 
http://www.djangoproject.com/docu
mentation/model-api/#many-to-one-relationships


Thanks.


-- 
Brian Rosner
http://oebfare.com



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-usersgooglegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribegooglegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )