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
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':
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.
>
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
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,
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
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
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
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
>
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
10 matches
Mail list logo