Ok, thanks for the example. On Mon, 2009-11-16 at 11:27 -0800, [email protected] wrote: > > if not cleaned.has_key("string2") and > > cleaned.has_key("string1"): > > cleaned["string2"] = string1 > > > > return cleaned > > > I think the problem here is that if string2 is not required it will be > in the cleaned dictionary but an empty string. So instead you might > need: > > if not cleaned.get('string2', ''): > cleaned['string2'] = string1 > > I'd still suggest doing it like this though, not in the POST, as you > would need to do that in every view where you use the form. > > Peter > > -- > > 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=. > -- Adam Stein @ Xerox Corporation Email: [email protected]
Disclaimer: Any/All views expressed here have been proven to be my own. [http://www.csh.rit.edu/~adam/] -- 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=.

