From 0def24381e972fb60ccc19b397184f3eb67c1aba Mon Sep 17 00:00:00 2001 From: Massimo Date: Tue, 26 Feb 2013 11:40:59 -0600 Subject: [PATCH] more attributes in virtual fields, thanks Donatas Burba --- VERSION | 2 +- gluon/dal.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index e13940b7..99e65240 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.4.1-alpha.2+timestamp.2013.02.25.23.19.14 +Version 2.4.1-alpha.2+timestamp.2013.02.26.11.40.15 diff --git a/gluon/dal.py b/gluon/dal.py index c44e0d40..ecd6111a 100644 --- a/gluon/dal.py +++ b/gluon/dal.py @@ -9027,9 +9027,20 @@ class SQLCustomType(object): return self._class class FieldVirtual(object): - def __init__(self, name, f=None): + def __init__(self, name, f=None, ftype='string',label=None,table_name=None): # for backward compatibility (self.name, self.f) = (name, f) if f else ('unkown', name) + self.type = ftype + self.label = label or self.name.capitalize().replace('_',' ') + self.represent = IDENTITY + self.formatter = IDENTITY + self.comment = None + self.readable = True + self.writable = False + self.requires = None + self.widget = None + self.tablename = table_name + self.filter_out = None class FieldMethod(object): def __init__(self, name, f=None, handler=None):