Changeset 1186 for trunk/camelot/view/field_attributes.py
- Timestamp:
- 03/13/10 12:31:24 (6 months ago)
- Files:
-
- 1 modified
-
trunk/camelot/view/field_attributes.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/camelot/view/field_attributes.py
r1179 r1186 31 31 import camelot.types 32 32 import datetime 33 import operator 33 34 34 35 from controls import delegates … … 45 46 ) 46 47 48 _numerical_operators = (operator.eq, operator.lt, operator.le, operator.gt, operator.ge) 47 49 48 50 _sqlalchemy_to_python_type_ = { … … 53 55 'nullable': True, 54 56 'delegate': delegates.BoolDelegate, 55 'from_string': bool_from_string 57 'from_string': bool_from_string, 58 'operators' : (operator.eq,), 56 59 }, 57 60 … … 61 64 'nullable': True, 62 65 'delegate': delegates.BoolDelegate, 63 'from_string': bool_from_string 66 'from_string': bool_from_string, 67 'operators' : (operator.eq,), 64 68 }, 65 69 … … 72 76 'nullable': True, 73 77 'delegate': delegates.DateDelegate, 74 'from_string': date_from_string 78 'from_string': date_from_string, 79 'operators' : _numerical_operators, 75 80 }, 76 81 … … 83 88 'format': constants.camelot_time_format, 84 89 'nullable': True, 85 'from_string': time_from_string 90 'from_string': time_from_string, 91 'operators': _numerical_operators, 86 92 }, 87 93 … … 94 100 'nullable': True, 95 101 'delegate': delegates.DateTimeDelegate, 96 'from_string': datetime_from_string 102 'from_string': datetime_from_string, 103 'operators': _numerical_operators, 97 104 }, 98 105 … … 105 112 'nullable': True, 106 113 'delegate': delegates.FloatDelegate, 107 'from_string': float_from_string 114 'from_string': float_from_string, 115 'operators': _numerical_operators, 108 116 }, 109 117 … … 117 125 'from_string': int_from_string, 118 126 'to_string': unicode, 119 'widget': 'int' 127 'widget': 'int', 128 'operators': _numerical_operators, 120 129 }, 121 130 … … 128 137 'delegate': delegates.IntegerDelegate, 129 138 'from_string': int_from_string, 130 'widget': 'int' 139 'widget': 'int', 140 'operators': _numerical_operators, 131 141 }, 132 142
