def range_filter(value, f1, f2):
    q1 = Q(**{f1 + '__isnull': True}) | Q(**{f1 + '__lte': value})
    q2 = Q(**{f2 + '__isnull': True}) | Q(**{f2 + '__gte': value})
    return Q(q1, q2)
Get all photos belonging to a specific user, tagged by the given keyword
dataset/ETHPy150Open lsaffre/lino/lino/core/utils.py/range_filter--crossover with--dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/photos/service.py/PhotosService.GetTaggedPhotos