def update_dashboard_stats_log(user_id):
 model = user_models.UserStatsModel.get_or_create(user_id)
 if (model.schema_version != feconf.CURRENT_DASHBOARD_STATS_SCHEMA_VERSION):
  _migrate_dashboard_stats_to_latest_schema(model)
 weekly_dashboard_stats = {get_current_date_as_string(): {'num_ratings': (model.num_ratings or 0), 'average_ratings': model.average_ratings, 'total_plays': (model.total_plays or 0)}}
 model.weekly_creator_stats_list.append(weekly_dashboard_stats)
 model.put()

def update_dashboard_stats_log ( user_id ) : model = user_models . UserStatsModel . get_or_create ( user_id ) if ( model . schema_version != feconf . CURRENT_DASHBOARD_STATS_SCHEMA_VERSION ) : _migrate_dashboard_stats_to_latest_schema ( model ) weekly_dashboard_stats = { get_current_date_as_string ( ) : { 'num_ratings' : ( model . num_ratings or 0 ) , 'average_ratings' : model . average_ratings , 'total_plays' : ( model . total_plays or 0 ) } } model . weekly_creator_stats_list . append ( weekly_dashboard_stats ) model . put ( )
save statistics for creator dashboard of a user by appending to a list keyed by a datetime string .