Re: Pre-filling form data without submission?

2009-04-08 Thread Hernan Olivera
My (working code)solution: form = CargaRecetaForm(initial={'obra_social':str(os.siglaosocial), 'plan':str(plan.descplan), 'CU': str(numfar), 'NrodeOrden': str(sigord)}) contexto = RequestContext(request, {'form':form}) return render_to_response('carga_page2.html', contexto) -- Hernan Olivera

Re: Pre-filling form data without submission?

2009-04-08 Thread Facundo Casco
On Wed, Apr 8, 2009 at 12:28 PM, Adi Sieker wrote: > > If you create tHe Form ala > > form = Form( initial={'user': request.user}) > > it should prepopulate the field and not throw validation errors. > > if on the other hand you create the form like: > > form = Form({'user':

Re: Pre-filling form data without submission?

2009-04-08 Thread Adi Sieker
On 08.04.2009, at 17:10, Facundo Casco wrote: > > On Tue, Jan 20, 2009 at 11:17 AM, shogunm...@googlemail.com > wrote: >> >> Thanks guys, I'm gonna give this a try! >> >> Mike. > Hi, I'm having the exact same problem you had and I can't find a nice > way around it. >

Re: Pre-filling form data without submission?

2009-04-08 Thread Facundo Casco
On Tue, Jan 20, 2009 at 11:17 AM, shogunm...@googlemail.com wrote: > > Thanks guys, I'm gonna give this a try! > > Mike. Hi, I'm having the exact same problem you had and I can't find a nice way around it. I want the name of the currently logged in user to be

Re: Pre-filling form data without submission?

2009-01-20 Thread shogunm...@googlemail.com
Thanks guys, I'm gonna give this a try! Mike. On Jan 20, 1:53 pm, Daniel Roseman wrote: > On Jan 20, 12:56 pm, "shogunm...@googlemail.com" > > > > wrote: > > Hi Thomas, > > > Thanks for your quick reply! > > > I had a look at the docs,

Re: Pre-filling form data without submission?

2009-01-20 Thread Daniel Roseman
On Jan 20, 12:56 pm, "shogunm...@googlemail.com" wrote: > Hi Thomas, > > Thanks for your quick reply! > > I had a look at the docs, but it seems I have to enter the initial > values at the Form definition level. However, I am interested in > entering dynamic data

Re: Pre-filling form data without submission?

2009-01-20 Thread Thomas Guettler
Hi, at python level you can do it like this (untested): def myview(request, ...): form=MyForm(..., initial={'email': request.user.email}) or form.fields['email'].initial=request.user.email shogunm...@googlemail.com schrieb: > Hi Thomas, > > Thanks for your quick reply! > > I had a look

Re: Pre-filling form data without submission?

2009-01-20 Thread shogunm...@googlemail.com
Hi Thomas, Thanks for your quick reply! I had a look at the docs, but it seems I have to enter the initial values at the Form definition level. However, I am interested in entering dynamic data depending on who is viewing the form. For instance, in my case I want the user's email address to be

Re: Pre-filling form data without submission?

2009-01-20 Thread Thomas Guettler
shogunm...@googlemail.com schrieb: > Hi guys, > > I've hunted around the docs and googled this (it's quite a niche > scenario so a bit hard to find!) and I'm still a bit stuck! I was > hoping somebody might be able to help out! > > Can anyone tell me how to pre-fill form data without the form >

Pre-filling form data without submission?

2009-01-20 Thread shogunm...@googlemail.com
Hi guys, I've hunted around the docs and googled this (it's quite a niche scenario so a bit hard to find!) and I'm still a bit stuck! I was hoping somebody might be able to help out! Can anyone tell me how to pre-fill form data without the form automatically calling submit on the form so that