make sure query criteria is a number for a 'number' field
This commit is contained in:
		
							parent
							
								
									67b969a481
								
							
						
					
					
						commit
						b63b3b3b16
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		|  | @ -162,6 +162,9 @@ class LeafQueryCriteria(BaseQueryCriteria, Element): | |||
|             if comparisonValue in (None, '',): | ||||
|                 return True | ||||
|         value = self.field.getSelectValue(row) | ||||
|         if (self.field.fieldType == 'number' and  | ||||
|                 isinstance(comparisonValue, basestring)): | ||||
|             comparisonValue = int(comparisonValue) | ||||
|         op = operators.get(self.operator) | ||||
|         if op is None: | ||||
|             op = getattr(standard_operators, self.operator, None) | ||||
|  |  | |||
|  | @ -72,8 +72,8 @@ class Field(Component): | |||
|         return row.getRawValue(self.name) | ||||
| 
 | ||||
|     def getSelectValue(self, row): | ||||
|         return getattr(row, self.name, None) | ||||
|         #return self.getRawValue(row)   # better let row control selection... | ||||
|         return getattr(row, self.name, None) # backwards compatibility | ||||
|         # return self.getRawValue(row)       # overwrite with this in subclass | ||||
| 
 | ||||
|     def getValue(self, row): | ||||
|         value = self.getRawValue(row) | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue