Dynamically adding values to related foreign key field in the form

36 views
Skip to first unread message

Guruprasad L

unread,
Oct 5, 2012, 3:47:05 PM10/5/12
to django...@googlegroups.com
Hi all,

Is it possible to add a value for a foreign key field from a form that is actually using it. For example, I have seen in the admin app that whenever there is a foreign key field, there is a way to add new items to that field via a popup window and the added value gets added to the list of foreign key values. If you want an example, if I am writing a blog post and I have a list of categories, I want to be able to use the list of existing categories or to create a new category from the same form used to create the blog post. Is it possible? If so, how should I go about implementing it?

Thanks & Regards,
Guruprasad
Reply all
Reply to author
Forward
0 new messages