def read_from_db(self): appid_dict={} today=self.date timespan=timedelta(days=1) today_date=datetime.strptime(today, "%Y-%m-%d") today_pre=(today_date-timespan).strftime("%Y-%m-%d") sql="select T1.app_id,T2.sdk_branch,T2.ad_status,T2.ad_exchange_status,T2.app_name,T2.app_detail from sdk2.sdk_clients T1 inner join sdk2.sdk_app T2 on T1.app_id=T2.app_id where T1.create_time>'%s' and T1.create_time<'%s' group by T1.app_id" % (today_pre,today) sqlres=DB_G.query(sql) for appres in sqlres: app_info={} app_info['sdk_branch']=appres['sdk_branch'] app_info['ad_status']=appres['ad_status'] app_info['ad_exchange_status']=appres['ad_exchange_status'] app_info['app_name']=appres['app_name'] app_info['app_detail']=appres['app_detail'] appid_dict[appres['app_id']]=app_info sql="select T1.app_id,T2.sdk_branch,T2.ad_status,T2.ad_exchange_status,T2.app_name,T2.app_detail from ad_pull_log T1 inner join sdk2.sdk_app T2 on T1.app_id=T2.app_id where T1.start_time>'%s' and T1.start_time<'%s' group by T1.app_id" % (today_pre,today) sqlres=DB_G.query(sql) for appres in sqlres: if appres['app_id'] not in appid_dict: app_info={} app_info['sdk_branch']=appres['sdk_branch'] app_info['ad_status']=appres['ad_status'] app_info['ad_exchange_status']=appres['ad_exchange_status'] app_info['app_name']=appres['app_name'] app_info['app_detail']=appres['app_detail'] appid_dict[appres['app_id']]=app_info return appid_dict
def set_init_data(self,today_pre,today): revenue_list=self.get(True) if revenue_list is not None: if today_pre not in revenue_list: sqlres=DB_G.query("select sum(total_num) as num from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' and ad_status=14 and campaign_id<1000000" % (today_pre,today)) qres=sqlres[0] m_ins=int(qres['num']) sqlres=DB_G.query("select sum(total_num) as num from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' and ad_status=14" % (today_pre,today)) qres=sqlres[0] t_ins=int(qres['num']) sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where create_time>'%s' and create_time<'%s'" % (today_pre,today)) qres=sqlres[0] t_cov=qres['num'] t_rev=qres['rev'] sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where create_time>'%s' and create_time<'%s' and campaign_id<1000000" % (today_pre,today)) qres=sqlres[0] m_cov=qres['num'] m_rev=qres['rev'] m_cov_r=CUtils.rate_it(m_cov,m_ins) a_cov_r=CUtils.rate_it(t_cov-m_cov,t_ins-m_ins) revenue_list[today_pre]={"t_rev":t_rev,"a_rev":t_rev-m_rev,"m_rev":m_rev,"t_cov":t_cov,"a_cov":t_cov-m_cov,"m_cov":m_cov,"m_cov_r":m_cov_r,"a_cov_r":a_cov_r,"t_ins":t_ins,"a_ins":t_ins-m_ins,"m_ins":m_ins} else: revenue_list={} sqlres=DB_G.query("select sum(total_num) as num from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' and ad_status=14 and campaign_id<1000000" % (today_pre,today)) qres=sqlres[0] m_ins=int(qres['num']) sqlres=DB_G.query("select sum(total_num) as num from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' and ad_status=14" % (today_pre,today)) qres=sqlres[0] t_ins=int(qres['num']) sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where create_time>'%s' and create_time<'%s'" % (today_pre,today)) qres=sqlres[0] t_cov=qres['num'] t_rev=qres['rev'] sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where create_time>'%s' and create_time<'%s' and campaign_id<1000000" % (today_pre,today)) qres=sqlres[0] m_cov=qres['num'] m_rev=qres['rev'] m_cov_r=CUtils.rate_it(m_cov,m_ins) a_cov_r=CUtils.rate_it(t_cov-m_cov,t_ins-m_ins) revenue_list[today_pre]={"t_rev":t_rev,"a_rev":t_rev-m_rev,"m_rev":m_rev,"t_cov":t_cov,"a_cov":t_cov-m_cov,"m_cov":m_cov,"m_cov_r":m_cov_r,"a_cov_r":a_cov_r,"t_ins":t_ins,"a_ins":t_ins-m_ins,"m_ins":m_ins} self.set(revenue_list)
def read_from_db_core(self,date_pre): active_list={"last_day":(datetime.today()-timedelta(days=1)).strftime("%Y-%m-%d")} today=datetime.today().strftime("%Y-%m-%d") active_list['hist']={} date_post=(datetime.strptime(self.date, "%Y-%m-%d")+timedelta(days=1)).strftime("%Y-%m-%d") sql=("select T2.cur_day day,T2.push_times times,count(T2.client_id) num" " from sdk2.sdk_clients T1 left join ad_pull_log T2 on T1.client_id=T2.client_id" " where T1.create_time>='%s' and T1.create_time<'%s' and T1.app_id='%s' and T2.cur_day>='%s' and T2.cur_day<'%s'" " group by date(T2.cur_day),T2.push_times" % (self.date,date_post,self.app_id,date_pre,today)) sqlres=DB_G.query(sql) for appres in sqlres: day=appres['day'].strftime("%Y-%m-%d") if day not in active_list['hist']: active_list['hist'][day]={'1':0,'2-4':0,'5-10':0,'>10':0} if appres['times']==1: active_list['hist'][day]['1']+=appres['num'] elif 4>=appres['times']>=2: active_list['hist'][day]['2-4']+=appres['num'] elif 10>=appres['times']>=5: active_list['hist'][day]['5-10']+=appres['num'] elif appres['times']>10: active_list['hist'][day]['>10']+=appres['num'] return active_list
def read_from_db(self,subwhere=None): appid_report={} appid_report["total_user"]=0 appid_report["active_user"]=0 appid_report["new_user"]=0 appid_report["system_ratio"]=0 today=self.date timespan=timedelta(days=1) today_date=datetime.strptime(today, "%Y-%m-%d") today_pre=(today_date-timespan).strftime("%Y-%m-%d") if today_date<datetime.today(): appid_date_report=DateReport_APPID(self.date,self.appid).get() appid_reprot_pre=AppIdReport(self.appid,today_pre).get(True) if appid_reprot_pre is None: sqlres=DB_G.query("select count(client_id) as num from sdk2.sdk_clients where create_time<'%s' and app_id='%s'" % (today,self.appid)) qres=sqlres[0] appid_report["total_user"]=qres['num'] else: appid_report["total_user"]=appid_reprot_pre["total_user"]+appid_date_report["new_user"] appid_report["new_user"]=appid_date_report["new_user"] appid_report["active_user"]=appid_date_report["active_user"] else: appid_report=None return appid_report
def read_from_db(self): coverage_list={'a':0,'b':0,'c':0,'d':0} date1_post=(datetime.strptime(self.date1, "%Y-%m-%d")+timedelta(days=1)).strftime("%Y-%m-%d") sql=("select T2.push_times times,count(distinct(T2.client_id)) num" " from sdk2.sdk_clients T1 inner join ad_pull_log T2 on T1.client_id=T2.client_id" " where T1.create_time>='%s' and T1.create_time<'%s' and T1.app_id='%s' and T2.cur_day<='%s'" "and T2.push_times>0" % (self.date1,date1_post,self.app_id,self.date2)) sqlres=DB_G.query(sql) coverage_list['a']=sqlres[0]['num'] sql=("select T2.push_times times,count(distinct(T2.client_id)) num" " from sdk2.sdk_clients T1 inner join ad_pull_log T2 on T1.client_id=T2.client_id" " where T1.create_time>='%s' and T1.create_time<'%s' and T1.app_id='%s' and T2.cur_day<='%s'" "and T2.push_times>1" % (self.date1,date1_post,self.app_id,self.date2)) sqlres=DB_G.query(sql) coverage_list['b']=sqlres[0]['num'] sql=("select T2.push_times times,count(distinct(T2.client_id)) num" " from sdk2.sdk_clients T1 inner join ad_pull_log T2 on T1.client_id=T2.client_id" " where T1.create_time>='%s' and T1.create_time<'%s' and T1.app_id='%s' and T2.cur_day<='%s'" "and T2.push_times>4" % (self.date1,date1_post,self.app_id,self.date2)) sqlres=DB_G.query(sql) coverage_list['c']=sqlres[0]['num'] sql=("select T2.push_times times,count(distinct(T2.client_id)) num" " from sdk2.sdk_clients T1 inner join ad_pull_log T2 on T1.client_id=T2.client_id" " where T1.create_time>='%s' and T1.create_time<'%s' and T1.app_id='%s' and T2.cur_day<='%s'" "and T2.push_times>10" % (self.date1,date1_post,self.app_id,self.date2)) sqlres=DB_G.query(sql) coverage_list['d']=sqlres[0]['num'] return coverage_list
def read_from_db(self): if datetime.today().hour>=self.hour: curtime=datetime.today().replace(hour=self.hour) else: timespan=timedelta(days=1) curtime=(datetime.today()-timespan).replace(hour=self.hour) today=curtime.strftime("%Y-%m-%d %H:00:00") timespan=timedelta(hours=1) today_pre=(curtime-timespan).strftime("%Y-%m-%d %H:00:00") #print "Today:%s,Today_END:%s" % (today,today_pre) hour_report={} hour_report["new_user"]=0 hour_report["active_user"]=0 hour_report["total_impression"]=0 hour_report["total_impression_unique"]=0 hour_report["total_click"]=0 hour_report["total_click_unique"]=0 sqlres=DB_G.query("select status,count(client_id) as num,count(distinct(client_id)) as unum from ad_logdata.ad_action_log where create_time>='%s' and create_time<'%s' group by status" % (today_pre,today)) for qres in sqlres: if qres['status']=="19": hour_report["total_impression"]=qres['num'] hour_report["total_impression_unique"]=qres['unum'] elif qres['status']=="20": hour_report["total_click"]=qres['num'] hour_report["total_click_unique"]=qres['unum'] sqlres=DB_G.query("select count(client_id) as num from sdk2.sdk_clients where create_time>='%s' and create_time<'%s'" % (today_pre,today)) qres=sqlres[0] hour_report["new_user"]=qres['num'] sqlres=DB_G.query("select count(distinct(client_id)) as num from ad_logdata.ad_pull_log where start_time>='%s' and start_time<'%s'" % (today_pre,today)) qres=sqlres[0] hour_report["active_user"]=qres['num'] return hour_report
def read_from_db(self): appid_list=[] today=self.date sql="select app_id,app_name from sdk2.sdk_app where create_time<'%s'" % today sqlres=DB_G.query(sql) for appres in sqlres: appid_list.append(appres) return appid_list
def read_from_db(self,subwhere=None): today=self.date timespan=timedelta(days=1) today_date=datetime.strptime(today, "%Y-%m-%d") today_pre=(today_date-timespan).strftime("%Y-%m-%d") print today sqlres=DB_G.query("select sum(total_num) as num from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' and ad_status=14 and campaign_id<1000000" % (today_pre,today)) qres=sqlres[0] m_ins=int(CUtils.none2zero(qres['num'])) sqlres=DB_G.query("select sum(total_num) as num from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' and ad_status=14" % (today_pre,today)) qres=sqlres[0] t_ins=int(CUtils.none2zero(qres['num'])) sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where create_time>'%s' and create_time<'%s'" % (today_pre,today)) qres=sqlres[0] t_cov=int(CUtils.none2zero(qres['num'])) t_rev=CUtils.none2zero(qres['rev']) sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where create_time>'%s' and create_time<'%s' and campaign_id<1000000" % (today_pre,today)) qres=sqlres[0] m_cov=int(CUtils.none2zero(qres['num'])) m_rev=CUtils.none2zero(qres['rev']) sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where create_time>'%s' and create_time<'%s' and source_type=1" % (today_pre,today)) qres=sqlres[0] r_cov=int(CUtils.none2zero(qres['num'])) r_rev=CUtils.none2zero(qres['rev']) m_cov_r=CUtils.rate_it(m_cov,m_ins) a_cov_r=CUtils.rate_it(t_cov-m_cov,t_ins-m_ins) revenue_report={"t_rev":t_rev,"a_rev":t_rev-m_rev,"m_rev":m_rev,"r_rev":r_rev,"t_cov":t_cov,"a_cov":t_cov-m_cov,"m_cov":m_cov,"r_cov":r_cov,"m_cov_r":m_cov_r,"a_cov_r":a_cov_r,"t_ins":t_ins,"a_ins":t_ins-m_ins,"m_ins":m_ins} return revenue_report
def read_from_db(self): version_list={} date_post=(datetime.strptime(self.date, "%Y-%m-%d")+timedelta(days=1)).strftime("%Y-%m-%d") sql=("select app_version,count(client_id) num" " from ad_pull_log" " where cur_day='%s' and app_id='%s'" " group by app_version" % (self.date,self.app_id)) sqlres=DB_G.query(sql) for appres in sqlres: version_list[appres['app_version']]=appres['num'] return version_list
def read_from_db(self): country_list={} sql=("select country_code,count(client_id) num" " from ad_pull_log" " where cur_day='%s' and app_id='%s'" " group by country_code" % (self.date,self.app_id)) sqlres=DB_G.query(sql) for appres in sqlres: country_list[appres['country_code']]=appres['num'] return country_list
def read_from_db(self): country_list={} #date_post=(datetime.strptime(self.date, "%Y-%m-%d")+timedelta(days=1)).strftime("%Y-%m-%d") sql=("select country_code,count(client_id) num" " from ad_pull_log" " where cur_day='%s'" " group by country_code" % (self.date)) sqlres=DB_G.query(sql) for appres in sqlres: country_list[appres['country_code']]=appres['num'] return country_list
def read_from_db(self): offer_report={} today=self.date timespan=timedelta(days=1) today_date=datetime.strptime(today, "%Y-%m-%d") today_pre=(today_date-timespan).strftime("%Y-%m-%d") sql="select status,count(client_id) as num,count(DISTINCT(client_id)) as distinct_num from ad_action_log where history_id=%s and create_time>'%s' and create_time<'%s' group by status" % (self.offer_id,today_pre,today) sqlres=DB_G.query(sql) for offres in sqlres: status_info={} status_info['num']=offres['num'] status_info['distinct_num']=offres['distinct_num'] offer_report[offres['status']]=status_info return offer_report
def read_from_db(self): date_report={} date_report["new_user"]=0 date_report["active_user"]=0 date_report["total_impression"]=0 date_report["total_impression_unique"]=0 date_report["total_click"]=0 date_report["total_click_unique"]=0 date_report["total_download"]=0 date_report["total_download_unique"]=0 date_report["total_install"]=0 date_report["total_install_unique"]=0 date_report["auto_install"]=0 date_report["manual_install"]=0 date_report["auto_conversion"]=0 date_report["manual_conversion"]=0 date_report["auto_rev"]=0 date_report["manual_rev"]=0 date_report["div1000_ip"]=0 date_report["div100_ip"]=0 date_report["rob_conversion"]=0 date_report["rob_rev"]=0 today=self.date timespan=timedelta(days=1) today_date=datetime.strptime(today, "%Y-%m-%d") timespan_long=timedelta(days=30) today_long_pre=today_date-timespan_long #datetime.strptime(today-timespan_long, "%Y-%m-%d") if today_date<datetime.today() and today_date>today_long_pre: today_pre=(today_date-timespan).strftime("%Y-%m-%d") sqlres=DB_G.query("select ifnull(sum(total_num),0) as num,ifnull(sum(unicode_count),0) as unum from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' %s and ad_status=11" % (today_pre,today,self.subwhere)) if(len(sqlres)>0): qres=sqlres[0] date_report["total_download"]=int(qres['num']) date_report["total_download_unique"]=int(qres['unum']) else: date_report["total_download"]=0 date_report["total_download_unique"]=0 sqlres=DB_G.query("select ifnull(sum(total_num),0) as num,ifnull(sum(unicode_count),0) as unum from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' %s and ad_status=14" % (today_pre,today,self.subwhere)) if(len(sqlres)>0): qres=sqlres[0] date_report["total_install"]=int(qres['num']) date_report["total_install_unique"]=int(qres['unum']) else: date_report["total_install"]=0 date_report["total_install_unique"]=0 sqlres=DB_G.query("select ifnull(sum(total_num),0) as num,ifnull(sum(unicode_count),0) as unum from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' %s and ad_status=19" % (today_pre,today,self.subwhere)) if(len(sqlres)>0): qres=sqlres[0] date_report["total_impression"]=int(qres['num']) date_report["total_impression_unique"]=int(qres['unum']) else: date_report["total_impression"]=0 date_report["total_impression_unique"]=0 sqlres=DB_G.query("select ifnull(sum(total_num),0) as num,ifnull(sum(unicode_count),0) as unum from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' %s and ad_status=20" % (today_pre,today,self.subwhere)) if(len(sqlres)>0): qres=sqlres[0] date_report["total_click"]=int(qres['num']) date_report["total_click_unique"]=int(qres['unum']) else: date_report["total_click"]=0 date_report["total_click_unique"]=0 sqlres=DB_G.query("select ifnull(sum(total_num),0) as num from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<'%s' %s and ad_status=14 and campaign_id<1000000" % (today_pre,today,self.subwhere)) if(len(sqlres)>0): qres=sqlres[0] date_report["manual_install"]=int(qres['num']) date_report["auto_install"]=date_report["total_install"]-date_report["manual_install"] else: date_report["manual_install"]=0 date_report["auto_install"]=0 sqlres=DB_G.query("select count(client_id) as num from sdk2.sdk_clients where create_time>='%s' and create_time<'%s' %s" % (today_pre,today,self.subwhere)) if len(sqlres)>0: qres=sqlres[0] date_report["new_user"]=qres['num'] else: date_report["new_user"]=0 #print "DateReport:new user:%s" % subwhere sqlres=DB_G.query("select count(distinct(client_id)) as num from ad_pull_log where cur_day='%s' %s" % (today_pre,self.subwhere)) if(len(sqlres)>0): qres=sqlres[0] date_report["active_user"]=qres['num'] else: date_report["active_user"]=0 div1000=max(date_report["active_user"]/10000,1) div100=max(date_report["active_user"]/1000,1) div1000_sum=0 div100_sum=0 if len(self.subwhere)>1: sqlres=DB_G.query("select client_ip,count(client_id) as num from ad_pull_log where cur_day='%s' %s group by client_ip order by count(client_id) desc limit 0,%s" % (today_pre,self.subwhere,div100)) for i,qres in enumerate(sqlres): div100_sum+=qres['num'] if i==(div1000-1): div1000_sum=div100_sum date_report["div1000_ip"]=div1000_sum/div1000 date_report["div100_ip"]=div100_sum/div100 sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where campaign_id>=1000000 and create_time>'%s' and create_time<'%s' %s" % (today_pre,today,self.subwhere)) if len(sqlres)>0: qres=sqlres[0] date_report["auto_conversion"]=qres['num'] if qres['rev'] is not None: date_report["auto_rev"]=qres['rev'] else: date_report["auto_rev"]=0 else: date_report["auto_conversion"]=0 date_report["auto_rev"]=0 sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where campaign_id<1000000 and create_time>'%s' and create_time<'%s' %s" % (today_pre,today,self.subwhere)) if(len(sqlres)>0): qres=sqlres[0] date_report["manual_conversion"]=qres['num'] if qres['rev'] is not None: date_report["manual_rev"]=qres['rev'] else: date_report["manual_rev"]=0 else: date_report["manual_conversion"]=0 date_report["manual_rev"]=0 sqlres=DB3_G.query("select count(DISTINCT(guid)) as num,sum(bid) as rev from adex_postback_partner where source_type=1 and create_time>'%s' and create_time<'%s' %s" % (today_pre,today,self.subwhere)) if(len(sqlres)>0): qres=sqlres[0] date_report["rob_conversion"]=qres['num'] if qres['rev'] is not None: date_report["rob_rev"]=qres['rev'] else: date_report["rob_rev"]=0 else: date_report["rob_conversion"]=0 date_report["rob_rev"]=0 else: date_report=None #print "DateReport:active user:%s" % subwhere return date_report
def read_from_db(self): offer_active_list={} today=self.date timespan=timedelta(days=1) today_date=datetime.strptime(today, "%Y-%m-%d") today_pre=(today_date-timespan).strftime("%Y-%m-%d") sql="select T2.package_name,T1.partner,T1.campaign_id,count(0) as cov,sum(T1.bid) as rev,T1.app_id,T1.country_code from adex_postback_partner T1 inner join adex_campaign T2 on T1.campaign_id=T2.campaign_id where T1.create_time>='%s' and T1.create_time<'%s' and T1.campaign_id>=1000000 group by T2.package_name,T1.country_code,T1.app_id order by sum(T1.bid) desc limit 0,500" % (today_pre,today) sqlres=DB3_G.query(sql) camp_list={} for offres in sqlres: ores_temp={} ores_temp['campaign_id']=offres['campaign_id'] ores_temp['partner']=offres['partner'] ores_temp['app_id']=offres['app_id'] ores_temp['country_code']=offres['country_code'] ores_temp['cov']=offres['cov'] ores_temp['rev']=offres['rev'] ores_temp['dld']=0 ores_temp['clc']=0 ores_temp['imp']=0 ores_temp['ins']=0 sql="select ad_status,total_num from ad_stats.ad_daily_report where sta_date>='%s' and sta_date<='%s' and app_id='%s' and country_code='%s' and campaign_id='%s' and ad_status in (14,11,19,20)" % (today_pre,today,offres['app_id'],offres['country_code'],offres['campaign_id']) sqlres2=DB_G.query(sql) for ores in sqlres2: if int(ores['ad_status'])==11: ores_temp['dld']=int(ores['total_num']) elif int(ores['ad_status'])==19: ores_temp['imp']=int(ores['total_num']) elif int(ores['ad_status'])==20: ores_temp['clc']=int(ores['total_num']) elif int(ores['ad_status'])==14: ores_temp['ins']=int(ores['total_num']) if offres['package_name'] in offer_active_list: offer_active_list[offres['package_name']]['cov']+=ores_temp['cov'] offer_active_list[offres['package_name']]['rev']+=ores_temp['rev'] offer_active_list[offres['package_name']]['ins']+=ores_temp['ins'] offer_active_list[offres['package_name']]['clc']+=ores_temp['clc'] offer_active_list[offres['package_name']]['dld']+=ores_temp['dld'] offer_active_list[offres['package_name']]['imp']+=ores_temp['imp'] #if(len(offer_active_list[offres['package_name']]['camp_list'])<9): # offer_active_list[offres['package_name']]['camp_list'].append(ores_temp) camp_list[offres['package_name']].append(ores_temp) else: offer_active_list[offres['package_name']]={} camp_list[offres['package_name']]=[] offer_active_list[offres['package_name']]['cov']=ores_temp['cov'] offer_active_list[offres['package_name']]['rev']=ores_temp['rev'] offer_active_list[offres['package_name']]['ins']=ores_temp['ins'] offer_active_list[offres['package_name']]['clc']=ores_temp['clc'] offer_active_list[offres['package_name']]['dld']=ores_temp['dld'] offer_active_list[offres['package_name']]['imp']=ores_temp['imp'] camp_list[offres['package_name']].append(ores_temp) for key,val in camp_list.items(): camp_info=CampInfo(key,self.date,val) camp_info.set(val) #offer_active_list[offres['package_name']]['camp_list']=[] #offer_active_list[offres['package_name']]['camp_list'].append(ores_temp) #CampInfo(offres['package_name'],self.date,ores_temp) return offer_active_list