figures/tasks.py
def populate_single_cdm(course_id, date_for=None, force_update=False):
    '''Populates a CourseDailyMetrics record for the given date and course
    '''
    if date_for:
        date_for = as_date(date_for)

    # Provide info in celery log
    learner_count = CourseEnrollment.objects.filter(
        course_id=as_course_key(course_id)).count()
    msg = 'populate_single_cdm. course id = "{}", learner count={}'.format(
        course_id, learner_count)
    logger.info(msg)

    start_time = time.time()

    cdm_obj, _created = CourseDailyMetricsLoader(
        course_id).load(date_for=date_for, force_update=force_update)
    elapsed_time = time.time() - start_time
    logger.info('done. Elapsed time (seconds)={}. cdm_obj={}'.format(
        elapsed_time, cdm_obj))
Populates a CourseDailyMetrics record for the given date and course
    
Populates a CourseDailyMetrics record for the given date and course
Populates a CourseDailyMetrics record for the given date and course
def populate_single_cdm(course_id, date_for=None, force_update=False):
    if date_for:
        date_for = as_date(date_for)
    learner_count = CourseEnrollment.objects.filter(
        course_id=as_course_key(course_id)).count()
    msg = 'populate_single_cdm. course id = "{}", learner count={}'.format(
        course_id, learner_count)
    logger.info(msg)
    start_time = time.time()
    cdm_obj, _created = CourseDailyMetricsLoader(
        course_id).load(date_for=date_for, force_update=force_update)
    elapsed_time = time.time() - start_time
    logger.info('done. Elapsed time (seconds)={}. cdm_obj={}'.format(
        elapsed_time, cdm_obj))
def populate_single_cdm ( course_id , date_for = None , force_update = False ) : if date_for : date_for = as_date ( date_for ) learner_count = CourseEnrollment . objects . filter ( course_id = as_course_key ( course_id ) ) . count ( ) msg = 'populate_single_cdm. course id = "{}", learner count={}' . format ( course_id , learner_count ) logger . info ( msg ) start_time = time . time ( ) cdm_obj , _created = CourseDailyMetricsLoader ( course_id ) . load ( date_for = date_for , force_update = force_update ) elapsed_time = time . time ( ) - start_time logger . info ( 'done. Elapsed time (seconds)={}. cdm_obj={}' . format ( elapsed_time , cdm_obj ) )
Populates a CourseDailyMetrics record for the given date and course
Populates a CourseDailyMetrics record for the given date and course
'''Populates a CourseDailyMetrics record for the given date and course
    ''' # Provide info in celery log
course_id
date_for
force_update