Re: retrieving initial form data

2007-10-18 Thread Ken
Thanks! Exactly what I needed. I subsequently found it in newforms/ forms.py. Duh! I think my eyes just glazed over when I saw all that complicated new-style Python class stuff. On Oct 17, 1:10 pm, Doug B <[EMAIL PROTECTED]> wrote: > The bound data and initial data dicts are just set on

Re: retrieving initial form data

2007-10-17 Thread Doug B
The bound data and initial data dicts are just set on the form instance as form.data, and form.initial. This isn't 'clean' data though, so you are bypassing any newforms validation. a = AForm( initial = {'x': 1} ) a.initial['x'] --~--~-~--~~~---~--~~ You

retrieving initial form data

2007-10-17 Thread Ken
Given an instance of a form that was created with initial data, how do I extract a specific field value? For example, a = AForm( initial = {'x': 1} ) How do I find out what value the field named 'x' is? a.fields['x'] gives me a.fields['x'].initial returns None I am not interested in