On Friday, January 7, 2011 3:15:33 PM UTC, hank23 wrote: > > In the topics forms documentation there's an example of using a form > in a view which shows a return statement using a render_to_respone > shortcut like this: > > return render_to_response('contact.html', { > 'form': form, > }) > > but in the shortcuts documentation it shows an example of using > render_to_response not using forms and coded like this: > > return render_to_response('my_template.html', > my_data_dictionary, > > context_instance=RequestContect(request)) > > So if I want to use a form when coding a view how do I merge or > reconcile these two different examples so that my render_to_repsonse > will work properly? Please advise. Thanks.
These are not substantially different, and the minor differences have nothing to do with forms. The only difference is that one is using the additional context_instance argument, for which see here: http://docs.djangoproject.com/en/1.2/ref/templates/api/#subclassing-context-requestcontext but as I say, this has nothing to do with forms. Apart from using a literal dictionary instead of a variable containing a dictionary, there is no other difference between the two examples. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.