Project

General

Profile

« Previous | Next » 

Revision 1406

xml_func.py: range-related funcs: Made inputs optional in case they get set to NULL by _nullIf

View differences:

xml_func.py
173 173
def _rangeStart(items):
174 174
    items = dict(conv_items(str, items))
175 175
    try: value = items['value']
176
    except KeyError, e: raise SyntaxException(e)
176
    except KeyError: return None # input is empty
177 177
    return parse_range(value)[0]
178 178
funcs['_rangeStart'] = _rangeStart
179 179

  
180 180
def _rangeEnd(items):
181 181
    items = dict(conv_items(str, items))
182 182
    try: value = items['value']
183
    except KeyError, e: raise SyntaxException(e)
183
    except KeyError: return None # input is empty
184 184
    return parse_range(value)[1]
185 185
funcs['_rangeEnd'] = _rangeEnd
186 186

  
......
234 234
def _dateRangeStart(items):
235 235
    items = dict(conv_items(str, items))
236 236
    try: value = items['value']
237
    except KeyError, e: raise SyntaxException(e)
237
    except KeyError: return None # input is empty
238 238
    return dates.parse_date_range(value)[0]
239 239
funcs['_dateRangeStart'] = _dateRangeStart
240 240

  
241 241
def _dateRangeEnd(items):
242 242
    items = dict(conv_items(str, items))
243 243
    try: value = items['value']
244
    except KeyError, e: raise SyntaxException(e)
244
    except KeyError: return None # input is empty
245 245
    return dates.parse_date_range(value)[1]
246 246
funcs['_dateRangeEnd'] = _dateRangeEnd
247 247

  

Also available in: Unified diff