diff --git a/VERSION b/VERSION index a6884d6d..0b20db7d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-23 09:00:53) dev +Version 2.00.0 (2012-08-23 09:20:22) dev diff --git a/gluon/dal.py b/gluon/dal.py index 8d313931..30be93cc 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -174,7 +174,7 @@ import platform CALLABLETYPES = (types.LambdaType, types.FunctionType, types.BuiltinFunctionType, types.MethodType, types.BuiltinMethodType) -TABLE_ARGS = ('migrate','primarykey','fake_migrate','format','singular','plural','trigger_name','sequence_name','common_filter','polymodel','table_class') +TABLE_ARGS = ('migrate','primarykey','fake_migrate','format','singular','plural','trigger_name','sequence_name','common_filter','polymodel','table_class','on_define') ################################################################################### # following checks allow the use of dal without web2py, as a standalone module @@ -6977,6 +6977,8 @@ def index(): sql_locker.release() else: table._dbt = None + on_define = args.get('on_define',None) + if on_define: on_define(table) return table def __iter__(self): @@ -8149,6 +8151,9 @@ class Field(Expression): self.label = label if label!=None else fieldname.replace('_',' ').title() self.requires = requires if requires!=None else [] + def set_attributes(self,*args,**attributes): + self.__dict__.update(*args,**attributes) + def clone(self,point_self_references_to=False,**args): field = copy.copy(self) if point_self_references_to and \