Hi,

I have a form where the user chooses her activity and then I
automatically fill the category field in the database according to her
activity. My question is where should live the code that do that? I
want it to be triggered once the user hits the submit button of the
form, I take the activity of the user, check in which category it is
and set the category field.

I couldn't find a place for that code, in the forms.py the
clean_category(self): is triggered at the right moment but it's not
intended to do that, is it? I tried but it only works when there is
actually a category entered. If not, I get a 'local variable
'category' referenced before assignment'. May be it's better to use
signals here?

Thanks,
Bastien
--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to