more attributes in virtual fields, thanks Donatas Burba
This commit is contained in:
2
VERSION
2
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
|
||||
|
||||
13
gluon/dal.py
13
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):
|
||||
|
||||
Reference in New Issue
Block a user