Subversion Repositories SmartDukaan

Rev

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

Rev 16683 Rev 16685
Line 72... Line 72...
72
            if existingAppOffer.offer_price <= float(offer['offerPrice']):
72
            if existingAppOffer.offer_price <= float(offer['offerPrice']):
73
                existingAppOffer.show = False
73
                existingAppOffer.show = False
74
                app_offer.show = True
74
                app_offer.show = True
75
            else:
75
            else:
76
                existingAppOffer.show = True
76
                existingAppOffer.show = True
-
 
77
                existingAppOffer.offer_active = True
77
                app_offer.show = False
78
                app_offer.show = False
78
    else:
79
    else:
79
        try:
80
        try:
80
            app_offer.offer_price = float(offer['offerPrice'])
81
            app_offer.offer_price = float(offer['offerPrice'])
81
        except:
82
        except:
Line 98... Line 99...
98
            if existingAppOffer.offer_price <= float(offer['offerPrice']):
99
            if existingAppOffer.offer_price <= float(offer['offerPrice']):
99
                existingAppOffer.show = False
100
                existingAppOffer.show = False
100
                app_offer.show = True
101
                app_offer.show = True
101
            else:
102
            else:
102
                existingAppOffer.show = True
103
                existingAppOffer.show = True
-
 
104
                existingAppOffer.offer_active
103
                app_offer.show = False
105
                app_offer.show = False
104
         
106
         
105
    '''            
107
    '''            
106
    app_offer = app_offers.get_by(affiliate_id=AFFILIATE_ID, affiliate_offer_id=offer['offerId'], package_name=offer['package_name'])
108
    app_offer = app_offers.get_by(affiliate_id=AFFILIATE_ID, affiliate_offer_id=offer['offerId'], package_name=offer['package_name'])
107
    
109
    
Line 145... Line 147...
145
        app_offer.ratings = offer.get('appRating')
147
        app_offer.ratings = offer.get('appRating')
146
        app_offer.downloads = offer.get('appDownloads')
148
        app_offer.downloads = offer.get('appDownloads')
147
        app_offer.image_url = offer.get('iconUrl')
149
        app_offer.image_url = offer.get('iconUrl')
148
    session.commit()
150
    session.commit()
149
    '''
151
    '''
-
 
152
    session.commit()
150
        
153
       
151
def markOfferAsInactive():
154
def markOfferAsInactive():
152
    all_active_offers = app_offers.query.filter(app_offers.affiliate_id==AFFILIATE_ID).filter(~app_offers.affiliate_offer_id.in_(ACTIVE_OFFERS)).filter(app_offers.offer_active==True).all()
155
    all_active_offers = app_offers.query.filter(app_offers.affiliate_id==AFFILIATE_ID).filter(~app_offers.affiliate_offer_id.in_(ACTIVE_OFFERS)).filter(app_offers.offer_active==True).all()
153
    for active_offer in all_active_offers:
156
    for active_offer in all_active_offers:
154
        active_offer.offer_active = False
157
        active_offer.offer_active = False
155
    session.commit()
158
    session.commit()