Project

General

Profile

« Previous | Next » 

Revision 965

xml_func.py: _range: Treat a None from or to value as an unknown (a la SQL NULL) and return None instead of raising a SyntaxException

View differences:

xml_func.py
44 44

  
45 45
def range_(items):
46 46
    items = dict(conv_items(float, items))
47
    try:
48
        to = items['to']
49
        from_ = items['from']
50
    except KeyError, e: raise SyntaxException(e)
47
    from_ = items.get('from', None)
48
    to = items.get('to', None)
49
    if from_ == None or to == None: return None
51 50
    return str(to - from_)
52 51

  
53 52
def avg(items):

Also available in: Unified diff