You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
I've went through the documentation for "modelforms" and "forms" but I
couldn't figure our how someone would set the default value for a form
field to a session variable.
I have a checkbox in my comment form that says "remember my
information". After a comment is submitted and if the checkbox is
checked I'm saving the persons name, email address, and website in
session variables.
Now I'm just trying to figure out how to get these session variables
to load as the default values in the form fields, if they exist.
Can anyone point me in the right direction?
Tyler Brownell
unread,
Jan 30, 2009, 5:04:29 PM1/30/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to django...@googlegroups.com
You can pass data to a form class as a dictionary, so just save a
dictionary of the values in your session under some name that you'll
know to use.
Ty
unread,
Feb 2, 2009, 9:48:46 PM2/2/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Django users
Yes, but that would bound the data to the form and the data would try
to be validated on page load. I'm looking to pass default values to an
unbound form.
On Jan 30, 7:13 pm, "Todd O'Bryan" <toddobr...@gmail.com> wrote:
> You can pass data to a form class as a dictionary, so just save a
> dictionary of the values in your session under some name that you'll
> know to use.
>