No but you can a computed field that reassembles the date and time into a 
datetime for use in your code

Field('start_datetime','datetime',compute = lambda row: 
datetime.datetime(row.start_date.year,...., row.start_time.minute)

On Monday, 25 January 2016 18:30:55 UTC-6, Ron Chatterjee wrote:
>
> I am trying to create a table like attached picture to make schedules. But 
> instead of datetime to be all together, I want to specify time and date 
> separately as its little better for readability purpose. Here is my simple 
> table. How do I add time separately from the date?  Ofc I can create an 
> array and do IS_IN_SET() like:
>
> import numpy
> time_a =range(1,13)
>
>
> days_in_week = ('Mon', 'Tues', 'wed', 'Thurs', 'Fri', 'Sat', 'Sun')
> db.define_table('schedule_meeting',
>                 Field('start_day_time','date'),
>                 Field('end_day_time', 'date'),
>                 Field('start_time', 'time),
>                 Field('days_in_week', 
> type='list:string',requires=IS_IN_SET(days_in_week, 
> multiple=True),widget=lambda field,  value: 
> SQLFORM.widgets.checkboxes.widget(field, value, style='divs', label=True, 
> _class='horizontal')))
>
> db.schedule_meeting.start_time.requires=IS_IN_SET(time_a)
>
> And then I probably have to do the same for the minutes and cat them 
> together. But its little inconvenient way to do it. Any better alternative?
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to