Show
Ignore:
Timestamp:
03/13/10 12:31:24 (6 months ago)
Author:
erikj
Message:

prepare expanded search and sorting of query proxy models

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/camelot/view/field_attributes.py

    r1179 r1186  
    3131import camelot.types 
    3232import datetime 
     33import operator 
    3334 
    3435from controls import delegates 
     
    4546) 
    4647 
     48_numerical_operators = (operator.eq, operator.lt, operator.le, operator.gt, operator.ge) 
    4749 
    4850_sqlalchemy_to_python_type_ = { 
     
    5355        'nullable': True, 
    5456        'delegate': delegates.BoolDelegate, 
    55         'from_string': bool_from_string 
     57        'from_string': bool_from_string, 
     58        'operators' : (operator.eq,), 
    5659    }, 
    5760 
     
    6164        'nullable': True, 
    6265        'delegate': delegates.BoolDelegate, 
    63         'from_string': bool_from_string 
     66        'from_string': bool_from_string, 
     67        'operators' : (operator.eq,), 
    6468    }, 
    6569 
     
    7276        'nullable': True, 
    7377        'delegate': delegates.DateDelegate, 
    74         'from_string': date_from_string 
     78        'from_string': date_from_string, 
     79        'operators' : _numerical_operators, 
    7580    }, 
    7681 
     
    8388            'format': constants.camelot_time_format, 
    8489            'nullable': True, 
    85             'from_string': time_from_string 
     90            'from_string': time_from_string, 
     91            'operators': _numerical_operators, 
    8692    }, 
    8793 
     
    94100        'nullable': True, 
    95101        'delegate': delegates.DateTimeDelegate, 
    96         'from_string': datetime_from_string 
     102        'from_string': datetime_from_string, 
     103        'operators': _numerical_operators, 
    97104    }, 
    98105 
     
    105112        'nullable': True, 
    106113        'delegate': delegates.FloatDelegate, 
    107         'from_string': float_from_string 
     114        'from_string': float_from_string, 
     115        'operators': _numerical_operators, 
    108116    }, 
    109117 
     
    117125        'from_string': int_from_string, 
    118126        'to_string': unicode, 
    119         'widget': 'int' 
     127        'widget': 'int', 
     128        'operators': _numerical_operators, 
    120129    }, 
    121130 
     
    128137        'delegate': delegates.IntegerDelegate, 
    129138        'from_string': int_from_string, 
    130         'widget': 'int' 
     139        'widget': 'int', 
     140        'operators': _numerical_operators, 
    131141    }, 
    132142