Not usually. In fact, I would say that the code given is wrong. It should be
user_form.save(commit=false), otherwise there’s a redundant DB call.
https://docs.djangoproject.com/en/1.7/topics/forms/modelforms/#the-save-method
> On Mar 1, 2015, at 12:30 PM, ADEWALE ADISA
Something like that. The essence of "form_save" is to save data from a form
to the fields of the User model in the database. The thing to note is that
a Form's save method returns the object that was saved. Also, a Form's save
method and model save method do the same thing
On 1 Mar 2015 20:30,
OK, thanks for the response. So the essence of the form_save() is to get
the user object in which the password property can be set properly.
Thanks alot
On Mar 1, 2015 6:38 PM, "Vijay Khemlani" wrote:
> Both save the user to the database, but "user_form.save()" leaves the
Both save the user to the database, but "user_form.save()" leaves the user
password in plain text (which won't work when the user tries to login
later) so the password must be set correctly
(user.set_password(user.password)) and then the user has to be saved again
for the correct (hashed) password
Hi guys, pls help with little explanation on the extract below from tango
tutorial. In the code, they call user_form().save() to save into database.
Then latter call user.save(). Pls what's the different between the two ?
Where did user.save() save to ?
from rango.forms import UserForm,
5 matches
Mail list logo