My models define Item and Collection, where Item has a foreign key set
to Collection.

On the form to create new Items, I want the user to be able to select
from their existing Collections (which is simple to implement) but
also be able to not select from their existing Collections, but enter
text in a text input to create a new Collection.

I have tried a few things, read through the newforms documentation,
and am not seeing what an appropriate approach to doing this is.
Particularly if I don't want to create the new Collection if there's
something else in the form that is invalid.

My latest attempt was just having a text input, where the form submit
process did a get_or_create on the name entered, but was having
troubles setting the Collection on the Item through the Form object.

Any thoughts on a good approach, or link to examples?

Thanks,
dc
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to