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
+3
View File
@@ -20,6 +20,7 @@ import decimal
import unicodedata import unicodedata
from cStringIO import StringIO from cStringIO import StringIO
from utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE from utils import simple_hash, web2py_uuid, DIGEST_ALG_BY_SIZE
from dal import FieldVirtual, FieldMethod
JSONErrors = (NameError, TypeError, ValueError, AttributeError, JSONErrors = (NameError, TypeError, ValueError, AttributeError,
KeyError) KeyError)
@@ -508,6 +509,8 @@ class IS_IN_DB(Validator):
fields = [f for f in table] fields = [f for f in table]
else: 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': if self.dbset.db._dbname != 'gae':
orderby = self.orderby or reduce(lambda a, b: a | b, fields) orderby = self.orderby or reduce(lambda a, b: a | b, fields)
groupby = self.groupby groupby = self.groupby