On Mon, Nov 25, 2013 at 8:22 AM, Daniel Roseman <daniel@roseman.org.uk> wrote:
> On Sunday, 24 November 2013 18:46:21 UTC, Timothy W. Cook wrote:
>>
>> On Sun, Nov 24, 2013 at 4:38 PM, Daniel Roseman <dan...@roseman.org.uk>
>> wrote:
>
> No, `f` is now an unsaved instance of the Review model, rather than a form
> (you should probably make that clearer by calling the instance `r` or
> `review`).
I will certainly call it something else now that I realize:
f = form.save(commit=False)
means to make a copy of the model without saving it to disk. I
previously (from the SO example) thought I was making a copy of he
form.
IT still isn't clear how form.save yeailds a copy of the model and not
a copy of the form.
> So you can modify it like you would any other model instance
> before calling save() - and of course this is the normal model save(), not
> the form's.
So the follow on to that is how (if 'f' is a model instance) does the
form data get into my model instance. I am sure that there is
somewhere in the docs or at least in the code that this can be seen?
Thanks,
Tim
--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
--
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+unsubscribe@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/CA%2B%3DOU3Xpw2M_kLrruEU5SqhrT7wxn5sYrz_KS0CKuLtmFkUNug%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment