Malcolm,
I got it working. Here it is:
if request['b_state'] == 'KS':
if request['seen_updates'] == '0':
a = theamount(request, 1.06)
data = request.POST.copy()
data['seen_updates'] = 1
f = ContactForm(data)
return render_to_response('checkout_form.htm', {'fo':
f, 'o': request.session['cart'], 'p': a, 'isitks': True})
////////////
Thanks for the help!
On Oct 14, 9:02 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2007-10-14 at 18:32 -0700, Greg wrote:
> > Malcolm,
> > I think I'm finally starting to get somewhere with this. I assigned
> > my hidden field the initial 0 value
>
> > seen_updates = forms.IntegerField(widget=forms.HiddenInput, initial=0)
>
> > I was thinking that I could just do the following
> > 'request['seen_updates'] = '1'' in my view and just resend
> > ContactForm(request.POST). However, I guess I can't assign a value to
> > a POST element.
>
> This is true. Quoting
> fromhttp://www.djangoproject.com/documentation/request_response/#attributes:
>
> "All attributes except session should be considered read-only."
>
> (for an HttpRequest instance).
>
> > So does that mean I need to create a data field that
> > populates my entire form again
>
> > data = {'seen_updates': 1'',
> > ... 'b_name': request['b_name'],
> > ... 'b_address': request['b_address'],
> > ... 'b_city': request['b_city']
> > etc....}
>
> data = request.POST.copy() is simpler. Then you can alter 'data' as it's
> just a dictionary (well, it's actually a QueryDict, as documented
> athttp://www.djangoproject.com/documentation/request_response/#querydic...but
> the difference is mostly academic for most uses).
>
> Regards,
> Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---