[web2py] Re: Time of registration

2012-11-19 Thread Daniele
Massimo, thanks for the reply.
I wasn't able to get it working with what you said but this seems to have 
done the trick instead:

Field('registration_time', 'datetime', requires=IS_DATETIME(), 
writable=False, readable=False, default=request.utcnow),

essentially, the requires field seems to have done some magic that the 
other fields weren't doing.
Thanks!

On Saturday, November 17, 2012 6:57:19 PM UTC, Massimo Di Pierro wrote:

 Field('registration_time', 'datetime') is you want the user to fill it in:

 Field('registration_time', 'datetime', default=request.now, 
 writable=False, readable=False)

 to make it automatic.

 On Friday, 16 November 2012 15:44:17 UTC-6, Daniele wrote:

 Guys I'm wondering when I get someone to register, I'd like to have a 
 field in my database for the datetime.
 In my db.py file, I have a Field('registration_time', 'datetime')

 However, how do I pass in that the time (now) is supposed to be taken 
 when the user submits the form?? I'm a bit confused about this.

 Thanks!



-- 





[web2py] Re: Time of registration

2012-11-17 Thread Massimo Di Pierro
Field('registration_time', 'datetime') is you want the user to fill it in:

Field('registration_time', 'datetime', default=request.now, writable=False, 
readable=False)

to make it automatic.

On Friday, 16 November 2012 15:44:17 UTC-6, Daniele wrote:

 Guys I'm wondering when I get someone to register, I'd like to have a 
 field in my database for the datetime.
 In my db.py file, I have a Field('registration_time', 'datetime')

 However, how do I pass in that the time (now) is supposed to be taken when 
 the user submits the form?? I'm a bit confused about this.

 Thanks!


--