djdb/review.py
def fetch_recent(max_num_returned=10, start_dt=None, days=None, author_key=None,
                 order="created"):
    """Returns the most recent reviews, in reverse chronological order."""
    if days is not None:
        if start_dt:
            end_dt = start_dt + timedelta(days=days)
        else:
            end_dt = datetime.now() + timedelta(days=days)
    else:
        end_dt = None

    rev_query = models.Document.all()
    rev_query.filter("doctype =", models.DOCTYPE_REVIEW)
    rev_query.order("-%s" % order)
    if author_key:
        author = db.get(author_key)
        rev_query.filter('author =', author)
    if start_dt:
        rev_query.filter('created >=', start_dt)
    if end_dt:
        rev_query.filter('created <', end_dt)

    return AutoRetry(rev_query).fetch(max_num_returned)
Returns the most recent reviews, in reverse chronological order.
Returns the most recent reviews, in reverse chronological order.
Returns the most recent reviews in reverse chronological order .
def fetch_recent(max_num_returned=10, start_dt=None, days=None, author_key=None,
                 order="created"):
    if days is not None:
        if start_dt:
            end_dt = start_dt + timedelta(days=days)
        else:
            end_dt = datetime.now() + timedelta(days=days)
    else:
        end_dt = None
    rev_query = models.Document.all()
    rev_query.filter("doctype =", models.DOCTYPE_REVIEW)
    rev_query.order("-%s" % order)
    if author_key:
        author = db.get(author_key)
        rev_query.filter('author =', author)
    if start_dt:
        rev_query.filter('created >=', start_dt)
    if end_dt:
        rev_query.filter('created <', end_dt)
    return AutoRetry(rev_query).fetch(max_num_returned)
def fetch_recent ( max_num_returned = 10 , start_dt = None , days = None , author_key = None , order = "created" ) : if days is not None : if start_dt : end_dt = start_dt + timedelta ( days = days ) else : end_dt = datetime . now ( ) + timedelta ( days = days ) else : end_dt = None rev_query = models . Document . all ( ) rev_query . filter ( "doctype =" , models . DOCTYPE_REVIEW ) rev_query . order ( "-%s" % order ) if author_key : author = db . get ( author_key ) rev_query . filter ( 'author =' , author ) if start_dt : rev_query . filter ( 'created >=' , start_dt ) if end_dt : rev_query . filter ( 'created <' , end_dt ) return AutoRetry ( rev_query ) . fetch ( max_num_returned )
Returns the most recent reviews, in reverse chronological order.
Returns the most recent reviews in reverse chronological order .
"""Returns the most recent reviews, in reverse chronological order."""
max_num_returned
start_dt
days
author_key
order