# coding: utf8
if auth.is_logged_in():
me=auth.user.id
else:
me=None
db.define_table('timesheet',
Field('empleado',db.auth_user),
Field('DesdeFecha', 'date'),
Field('HastaFecha', 'date'),
Field('primerdia',length=4,default='0'),
Field('segundodia',length=4, default='8'),
Field('TotalHours',default=None, update=None,
readable=False),
Field('SignedBy',db.auth_user,default=me,writable=False,readable=False),
Field('EntryFechaHora','datetime',default=request.now,writable=False,readable=False))
db.timesheet.empleado.requires=IS_IN_DB(db,'auth_user.id','%
(first_name)s')
db.timesheet.DesdeFecha.requires=IS_NOT_EMPTY()
db.timesheet.HastaFecha.requires=IS_NOT_EMPTY()
db.timesheet.primerdia.requires=[IS_NOT_EMPTY(),IS_FLOAT_IN_RANGE(0,
10,error_message=T('too small or too large!'))]
db.timesheet.segundodia.requires=[IS_NOT_EMPTY(),IS_FLOAT_IN_RANGE(0,
10,error_message=T('too small or too large!'))]
On Feb 17, 11:34 am, Massimo Di Pierro <[email protected]>
wrote:
> Can you post your model so I can try reproduce the problem?
>
> On Feb 17, 12:41 pm, greenpoise <[email protected]> wrote:
>
>
>
> > Ok, very cautious when I program cuz I am not an expert by any means.
> > My application just saves one value to the table. Even if I go through
> > web2py database administration tool, date values are not being saved
> > agh..annoying..I get no error whatsoever.
>
> > any help appreciated
>
> > thanks