My model have a field called 'city', it's a foreign key to City model.

The user have the option to select a city in a dropdown menu (Select 
widget), or click in a button and write the name of a new (not present in 
the database) city.

Using a ModelForm, I added an extra field called 'new_city' to my form, 
after that I wrote this clean method: 
https://gist.github.com/dirtycoder/73b70ae6f94acf215e61

I'm new to Django and writing my first "real" web app so I can be missing 
some concept about forms and validation.

Is this the best way to accomplish what I want?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a51ebb41-28ca-480c-bed2-bbd26a72a11e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to