In the latest version 1.89.1 ti does what you say if you set
default=None

On Nov 12, 3:10 pm, baloan <[email protected]> wrote:
> Hi,
>
> I have defined a table:
>
> username = auth.user and auth.user.username
>
> db.define_table('email',
>                 Field('email', 'string', length=40, notnull=False,
> unique=True, represent=lambda s: s),
>                 Field('active', 'boolean', default=True),
>                 Field('expires', 'date', default=None,
> represent=lambda s: s or 'Never'),
>                 Field('create_user', 'string', default=username,
> writable=False),
>                 Field('create_date', 'datetime', default=request.now,
> writable=False),
>                 Field('change_user', 'string', update=username,
> writable=False),
>                 Field('change_date', 'datetime', update=request.now,
> writable=False),
>                 )
>
> and get the following form on crud.create():
>
> Email:          []
> Active:                 [x]
> Expires:                []
> Create User:    baloan
> Create Date:    2010-11-12 21:53:58
> Change User:    baloan
> Change Date:    2010-11-12 21:53:58
> [Submit]
>
> Though not specified by using 'default', change user/date is filled
> with username and request.now. It doesn't change if I use
> default=None.
>
> Is there any way to leave Change User/Date empty with crud.create?
> Maybe I have a database table synchronisation problem? Where is
> default/update information kept?
>
> Regards, Andreas

Reply via email to