fixed issue VirtualFields in select options

This commit is contained in:
Massimo
2013-02-21 10:21:31 -06:00
parent 9c970632c5
commit 5d9fc2e9af
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.4.1-alpha.2+timestamp.2013.02.21.10.15.58
Version 2.4.1-alpha.2+timestamp.2013.02.21.10.20.58
+4 -1
View File
@@ -20,6 +20,7 @@ import decimal
import unicodedata
from cStringIO import StringIO
from utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE
from dal import FieldVirtual, FieldMethod
JSONErrors = (NameError, TypeError, ValueError, AttributeError,
KeyError)
@@ -507,7 +508,9 @@ class IS_IN_DB(Validator):
if self.fields == 'all':
fields = [f for f in table]
else:
fields = [table[k] for k in self.fields]
fields = [table[k] for k in self.fields]
ignore = (FieldVirtual,FieldMethod)
fields = filter(lambda f:not isinstance(f,ignore), fields)
if self.dbset.db._dbname != 'gae':
orderby = self.orderby or reduce(lambda a, b: a | b, fields)
groupby = self.groupby