2) Tables are only archived if they have a Field('modified_on','datetime') 
such as created by the signature.
Without it you do not know when changes are made and versioning is useless.

1) Does this work?

# on_define_bank
def on_define_bank(table): 
pass

# create table : bank
db.define_table('bank', 
Field('bank',notnull=True), 
auth.signature,
on_define = on_define_bank, 
format = '%(bank)s')

Whats is  on_define_bank supposed to do?

On Friday, 3 January 2014 23:54:41 UTC-6, 黄祥 wrote:
>
> hi,
>
> i wonder what is the correlation between auth signature and enable record 
> versioning.
> e.g.
> # on_define_bank
> def on_define_bank(table): 
> # notnull
> table.bank.notnull = True
>
> # create table : bank
> db.define_table('bank', 
> Field('bank'), 
> auth.signature,
> on_define = on_define_bank, 
> format = '%(bank)s')
>
> # enable_record_versioning
> db.bank._enable_record_versioning()
>
> # 1st question
> this one work fine but if i make it lazy for enable_record_versioning, the 
> archieve table is created but can't be accessed (it return an error), so i 
> must comment or disable auth.signature to make it work. i wonder it why?
> e.g.
> # on_define_bank
> def on_define_bank(table): 
> # enable_record_versioning
> table._enable_record_versioning()
> # notnull
> table.bank.notnull = True
>
> # create table : bank
> db.define_table('bank', 
> Field('bank'), 
> on_define = on_define_bank, 
> format = '%(bank)s')
>
> # 2nd question
> let say i didn't use enable_record_versioning for each table and use 
> auth.enable_record_versioning(db) at the end of define table. if i define 
> auth.signature for each table, it will create the table archieve 
> (enable_record_versioning is work), but when i comment or disable 
> auth.signature on each tables, only auth tables is get the table archieve 
> (enable_record_versioning work only in auth tables). i wonder it why?
>
> any explaination about this?
>
> thanks and best regards,
> stifan
>

-- 
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/groups/opt_out.

Reply via email to