the problem is not the resultset: it's how it's injected into the view!!!!

On Tuesday, August 9, 2016 at 8:28:23 PM UTC+2, Dave S wrote:
>
>
>
> On Tuesday, August 9, 2016 at 10:56:48 AM UTC-7, madhu nomula wrote:
>>
>> db.define_table('ActivityMapping', 
>>                 Field('mapping_id'), 
>>                 Field('resource_id',db.auth_user), 
>>                 Field('org_id',db.Organization), 
>>                 Field('solution_id',db.Solution), 
>>                 Field('activity_id',db.Activity), 
>>                 Field('activity_date','datetime', requires=IS_DATE()), 
>>                 Field('effort') 
>>                 ) 
>>
>>
> Thank you.  Which database engine are you connecting to?
>
> /dps
>  
>
>> On Tue, Aug 9, 2016 at 11:11 PM, Dave S <snide...@gmail.com> wrote: 
>> > 
>> > 
>> > On Tuesday, August 9, 2016 at 9:09:08 AM UTC-7, madhu nomula wrote: 
>> >> 
>> >> Hi, 
>> >> 
>> >> I am trying to read date output from controller, but I am getting 
>> value in 
>> >> View as decimal values: 
>> > 
>> > 
>> > Which DB backend are you using? 
>> > 
>> > Can you show your define_table() code? 
>> > 
>> > /dps 
>> > 
>> > 
>> >> 
>> >> 
>> >> controller Code: 
>> >> 
>> >>    rowslistPeriod = db(( 
>> >>     (db.AM.resource_id==db.auth_user.id)& 
>> >> 
>> >>                           (db.auth_user.id==auth.user.id) 
>> >> 
>> ).select(db.auth_user.first_name,db.db.Solution.solution_code,db.Activity.activity_name,
>>  
>>
>> >> db.AM.effort, db.AM.activity_date) 
>> >> return dict(recordlistPeriod=rowslistPeriod 
>> >> 
>> >> 
>> >> View Code: 
>> >> 
>> >>  $(containerPreviousRecords).append('{{for x in recordlistPeriod:}}'); 
>> >> 
>> >> 
>> >>            var ceffort= {{=x.AM.effort}}; 
>> >>          var cDate= {{=x.AM.activity_date.strftime("%m/%d/%Y")}}; 
>> >>      alert(cDate); 
>> >> 
>> >> 
>> >> ----------------- 
>> >> 
>> >> Here I am able to get number value (effort), when I am getting alert 
>> >> getting  x.AM.activity_date.strftime("%m/%d/%Y") values as 
>> >> decimal(0.0036789......) instead of Date. 
>> >> 
>> >> Please help me to get date. 
>> >> 
>> >> Thanks, 
>> >> MC 
>> > 
>> > -- 
>> > 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. 
>>
>

-- 
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