Ahhh... That sounds good. Too easy, in fact. I can't wait to give it a try!
Thanks! On Monday, July 28, 2014 11:17:16 AM UTC-7, Daniel Roseman wrote: > > On Monday, 28 July 2014 15:46:11 UTC+1, Tom Evans wrote: >> >> <snip> >> >> You can use kwargs, but it is much cleaner and less typing to use >> Model.objects.create() as you can omit the subsequent save() as >> create() creates valid objects (they have pks). >> >> > You're right as far as that goes, but note that OP is using a ModelForm: > so there is an even easier method. > > form = create_insp_m(request.POST) > if form.is_valid(): > insp = form.save() > > that way they can get rid of all the stuff involving `cleaned_data`, and > even the querying for the Pad object, as the ModelForm does it all already. > -- > DR. > -- 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 [email protected]. To post to this group, send email to [email protected]. 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/d7acd90f-eb02-420e-9db1-ea8c9372b162%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

