Subversion Repositories SmartDukaan

Rev

Rev 15791 | Rev 15941 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15791 Rev 15940
Line 67... Line 67...
67
        for offerObj in offers:
67
        for offerObj in offers:
68
            offer = self.convertToObj(offerObj)
68
            offer = self.convertToObj(offerObj)
69
            collection.update({"transactionId":offer.transactionId, "subTagId":offer.subTagId, "payOut":offer.payOut},{"$set":todict(offer)}, upsert=True)
69
            collection.update({"transactionId":offer.transactionId, "subTagId":offer.subTagId, "payOut":offer.payOut},{"$set":todict(offer)}, upsert=True)
70
            mcollection.update({"subTagId":offer.subTagId, "storeId":self.store_id, "subOrders.missingAff":True}, {"$set":{"subOrders.$.missingAff":False}})
70
            mcollection.update({"subTagId":offer.subTagId, "storeId":self.store_id, "subOrders.missingAff":True}, {"$set":{"subOrders.$.missingAff":False}})
71
    
71
    
72
    def scrapeAffiliate(self, startDate=datetime.datetime.today() - datetime.timedelta(days=10), endDate=datetime.datetime.today()):
72
    def scrapeAffiliate(self, startDate=datetime.today() - timedelta(days=10), endDate=datetime.today()):
73
        uri = AFFLIATE_TRASACTIONS_URL%(startDate.year,startDate.month,startDate.day,endDate.year,endDate.month,endDate.day)
73
        uri = AFFLIATE_TRASACTIONS_URL%(startDate.year,startDate.month,startDate.day,endDate.year,endDate.month,endDate.day)
74
        root = ET.parse(urllib2.urlopen(uri)).getroot()
74
        root = ET.parse(urllib2.urlopen(uri)).getroot()
75
        if len(root)> 0 and len(root[0])> 0:
75
        if len(root)> 0 and len(root[0])> 0:
76
            offers = []
76
            offers = []
77
            for child in root[0][0]:
77
            for child in root[0][0]: