playlists/tasks.py
def expunge_play_count(request):
    """Cron view to expire old play counts."""
    # Delete tracks that have not been incremented in the last week.
    qs = PlayCount.all().filter('modified <',
                                datetime.now() - timedelta(days=7))
    num = 0
    for ob in qs.fetch(1000):
        ob.delete()
        num += 1
    log.info('Deleted %s old play count entries' % num)
Cron view to expire old play counts.
Cron view to expire old play counts.
Cron view to expire old play counts .
def expunge_play_count(request):
    qs = PlayCount.all().filter('modified <',
                                datetime.now() - timedelta(days=7))
    num = 0
    for ob in qs.fetch(1000):
        ob.delete()
        num += 1
    log.info('Deleted %s old play count entries' % num)
def expunge_play_count ( request ) : qs = PlayCount . all ( ) . filter ( 'modified <' , datetime . now ( ) - timedelta ( days = 7 ) ) num = 0 for ob in qs . fetch ( 1000 ) : ob . delete ( ) num += 1 log . info ( 'Deleted %s old play count entries' % num )
Cron view to expire old play counts.
Cron view to expire old play counts .
"""Cron view to expire old play counts.""" # Delete tracks that have not been incremented in the last week.
request