djdb/comment.py
def fetch_recent(max_num_returned=10, start_dt=None, days=None):
    """Returns the most recent comments, 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

    com_query = models.Document.all()
    com_query.filter("doctype =", models.DOCTYPE_COMMENT)
    com_query.order("-created")
    if start_dt:
        com_query.filter("created >=", start_dt)
    if end_dt:
        com_query.filter("created <", end_dt)
    return AutoRetry(com_query).fetch(max_num_returned)
Returns the most recent comments, in reverse chronological order.
Returns the most recent comments, in reverse chronological order.
Returns the most recent comments in reverse chronological order .
def fetch_recent(max_num_returned=10, start_dt=None, days=None):
    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
    com_query = models.Document.all()
    com_query.filter("doctype =", models.DOCTYPE_COMMENT)
    com_query.order("-created")
    if start_dt:
        com_query.filter("created >=", start_dt)
    if end_dt:
        com_query.filter("created <", end_dt)
    return AutoRetry(com_query).fetch(max_num_returned)
def fetch_recent ( max_num_returned = 10 , start_dt = None , days = None ) : 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 com_query = models . Document . all ( ) com_query . filter ( "doctype =" , models . DOCTYPE_COMMENT ) com_query . order ( "-created" ) if start_dt : com_query . filter ( "created >=" , start_dt ) if end_dt : com_query . filter ( "created <" , end_dt ) return AutoRetry ( com_query ) . fetch ( max_num_returned )
Returns the most recent comments, in reverse chronological order.
Returns the most recent comments in reverse chronological order .
"""Returns the most recent comments, in reverse chronological order."""
max_num_returned
start_dt
days