Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed issue 1084

  • Loading branch information...
commit 2b1d9acba5f2a473adf245c73e9fdf9eeade93b9 1 parent 8a2d18b
@mdipierro mdipierro authored
Showing with 11 additions and 2 deletions.
  1. +1 −1  VERSION
  2. +4 −0 gluon/dal.py
  3. +6 −1 gluon/sqlhtml.py
View
2  VERSION
@@ -1 +1 @@
-Version 2.1.0 (2012-10-12 18:16:59) dev
+Version 2.1.0 (2012-10-12 22:16:19) dev
View
4 gluon/dal.py
@@ -6565,6 +6565,10 @@ def smart_query(fields,text):
elif op == 'startswith': new_query = field.startswith(value)
elif op == 'endswith': new_query = field.endswith(value)
else: raise RuntimeError, "Invalid operation"
+ elif field._db._adapter.dbengine=='google:datastore' and \
+ field.type in ('list:integer', 'list:string', 'list:reference'):
+ if op == 'contains': new_query = field.contains(value)
+ else: raise RuntimeError, "Invalid operation"
else: raise RuntimeError, "Invalid operation"
if neg: new_query = ~new_query
if query is None:
View
7 gluon/sqlhtml.py
@@ -1528,15 +1528,20 @@ def search_menu(fields,search_options=None):
'datetime':['=','!=','<','>','<=','>='],
'integer':['=','!=','<','>','<=','>='],
'double':['=','!=','<','>','<=','>='],
+ 'id':['=','!=','<','>','<=','>='],
+ 'reference':['=','!=','<','>','<=','>='],
'boolean':['=','!=']}
if fields[0]._db._adapter.dbengine=='google:datastore':
search_options['string'] = ['=','!=','<','>','<=','>=']
search_options['text'] = ['=','!=','<','>','<=','>=']
+ search_options['list:string'] = ['contains']
+ search_options['list:integer'] = ['contains']
+ search_options['list:reference'] = ['contains']
criteria = []
selectfields = []
for field in fields:
name = str(field).replace('.','-')
- options = search_options.get(field.type,None)
+ options = search_options.get(field.type.split(' ')[0],None)
if options:
label = isinstance(field.label,str) and T(field.label) or field.label
selectfields.append(OPTION(label, _value=str(field)))
Please sign in to comment.
Something went wrong with that request. Please try again.