def _get_limit(order_field, start=None, end=None):
    """ Produces a SQL condition the order_filed to be between start and end."""
    query = ""    
    if start is None and end is None:
        return None
    if start:
        query+="{0}>={1}".format(order_field, start) 
    if end:
        if start:
            query +=" AND "
        query+="{0}<={1}".format(order_field, end)
    return query