def find(*args, **kwargs):
    """
    kwargs supported:
        user: the username
        start_at: start datetime object
        end_at: end datetime object
        limit: # of objects to fetch
    """
    # default end_at to now and start to 1 day from now
    end_at = kwargs.get('end_at', datetime.datetime.now())
    start_at = kwargs.get('start_at', end_at - datetime.timedelta(days=1))

    # default # of records to fetch to be 50
    limit = kwargs.get('limit', 50)

    # if no user is defined, fetch for ALL
    user = kwargs.get('user', None)
    if user:
        return request_log.find(start_at, end_at, limit, spec={'user': user})
    else:
        return request_log.find(start_at, end_at, limit)
def find ( * args , ** kwargs ) : end_at = kwargs . get ( 'end_at' , datetime . datetime . now ( ) ) start_at = kwargs . get ( 'start_at' , end_at - datetime . timedelta ( days = 1 ) ) limit = kwargs . get ( 'limit' , 50 ) user = kwargs . get ( 'user' , None ) if user : return request_log . find ( start_at , end_at , limit , spec = { 'user' : user } ) else : return request_log . find ( start_at , end_at , limit )
kwargs supported:
        user: the username
        start_at: start datetime object
        end_at: end datetime object
        limit: # of objects to fetch