Seems to me the code should look like this:

form3 = SQLFORM.factory(Field('ddate', 'date', label='Enter a date'))

if form3.process().accepted:
    k = form3.vars.ddate.day()
    redirect(URL('readings', 'check', args=[k,k,k]))


return dict(formd=form3)


...but, I'm not entirely sure what you're trying to do here.  If you're 
trying to display the form and then act on the results of the form, I'd 
break the .process() out away from the form definition.

-Jim


On Monday, November 28, 2016 at 12:09:44 PM UTC-6, Yoel Benitez Fonseca 
wrote:
>
> Instead of: 
>
> form3 = SQLFORM.factory(Field('ddate','date', label='Enter a 
> date')).process() 
> if form3.accepted: 
>         k=form3.vars.ddate.day() 
>         redirect(URL('readings', 'check', args=[k,k,k])) 
>
> Do: 
>
> form3 = SQLFORM.factory(Field('ddate','date', label='Enter a 
> date')).process() 
> if form3.accepted: 
>         print form3.vars.ddate 
>         k=form3.vars.ddate.day() 
>         print k 
>         redirect(URL('readings', 'check', args=[k,k,k])) 
>
>
> And see what is shown in your shell 
>
> 2016-11-28 12:24 GMT-05:00 Mike Stephenson <raghi...@iiits.in 
> <javascript:>>: 
> > I am not getting the day of the month 
> > 
> > On Monday, November 28, 2016 at 10:47:13 PM UTC+5:30, Yoel Benitez 
> Fonseca 
> > wrote: 
> >> 
> >> and what value are u getting on 'k', the day of month i suppose !? 
> >> 
> >> 2016-11-28 9:56 GMT-05:00 Mike Stephenson <raghi...@iiits.in>: 
> >> > form3 = SQLFORM.factory(Field('ddate','date', label='Enter a 
> >> > date')).process() 
> >> > if form3.accepted: 
> >> >         k=form3.vars.ddate.day() 
> >> >         redirect(URL('readings', 'check', args=[k,k,k])) 
> >> > 
> >> > K doesn't read value as expected. 
> >> > 
> >> > -- 
> >> > Resources: 
> >> > - http://web2py.com 
> >> > - http://web2py.com/book (Documentation) 
> >> > - http://github.com/web2py/web2py (Source code) 
> >> > - https://code.google.com/p/web2py/issues/list (Report Issues) 
> >> > --- 
> >> > You received this message because you are subscribed to the Google 
> >> > Groups 
> >> > "web2py-users" group. 
> >> > To unsubscribe from this group and stop receiving emails from it, 
> send 
> >> > an 
> >> > email to web2py+un...@googlegroups.com. 
> >> > For more options, visit https://groups.google.com/d/optout. 
> >> 
> >> 
> >> 
> >> -- 
> >> Yoel Benítez Fonseca 
> >> http://redevil.cubava.cu/ 
> >> $ python -c "import this" 
> > 
> > -- 
> > Resources: 
> > - http://web2py.com 
> > - http://web2py.com/book (Documentation) 
> > - http://github.com/web2py/web2py (Source code) 
> > - https://code.google.com/p/web2py/issues/list (Report Issues) 
> > --- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "web2py-users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to web2py+un...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> Yoel Benítez Fonseca 
> http://redevil.cubava.cu/ 
> $ python -c "import this" 
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to