mod7-gaetasks/main.py
def fetch_visits(limit):
    'get most recent visits & add task to delete older visits'
    data = Visit.query().order(-Visit.timestamp).fetch(limit)
    oldest = time.mktime(data[-1].timestamp.timetuple())
    oldest_str = time.ctime(oldest)
    logging.info('Delete entities older than %s' % oldest_str)
    taskqueue.add(url='/trim', params={'oldest': oldest})
    return (v.to_dict() for v in data), oldest_str
get most recent visits & add task to delete older visits
get most recent visits & add task to delete older visits
get most recent visits & add task to delete older visits
def fetch_visits(limit):
    data = Visit.query().order(-Visit.timestamp).fetch(limit)
    oldest = time.mktime(data[-1].timestamp.timetuple())
    oldest_str = time.ctime(oldest)
    logging.info('Delete entities older than %s' % oldest_str)
    taskqueue.add(url='/trim', params={'oldest': oldest})
    return (v.to_dict() for v in data), oldest_str
def fetch_visits ( limit ) : data = Visit . query ( ) . order ( - Visit . timestamp ) . fetch ( limit ) oldest = time . mktime ( data [ - 1 ] . timestamp . timetuple ( ) ) oldest_str = time . ctime ( oldest ) logging . info ( 'Delete entities older than %s' % oldest_str ) taskqueue . add ( url = '/trim' , params = { 'oldest' : oldest } ) return ( v . to_dict ( ) for v in data ) , oldest_str
get most recent visits & add task to delete older visits
get most recent visits & add task to delete older visits
'get most recent visits & add task to delete older visits'
limit