コード例 #1
0
ファイル: campaign.py プロジェクト: arunvsuresh/appnexus-api
    def get_profile(self):
        if self.get('profile_id') > 0:
            if self.profile_obj is None:
                self.profile_obj = Profile(Campaign.connection).find_one(self.get('profile_id'), self.get('advertiser_id'))
        else:
            new_profile = Profile(Campaign.connection)
            new_profile['advertiser_id'] = self.get('advertiser_id')
            new_profile.create()
            self.profile_obj = new_profile
            self['profile_id'] = new_profile.get('id')

        return self.profile_obj
コード例 #2
0
ファイル: campaign.py プロジェクト: arunvsuresh/appnexus-api
    def get_profile(self):
        if self.get('profile_id') > 0:
            if self.profile_obj is None:
                self.profile_obj = Profile(Campaign.connection).find_one(
                    self.get('profile_id'), self.get('advertiser_id'))
        else:
            new_profile = Profile(Campaign.connection)
            new_profile['advertiser_id'] = self.get('advertiser_id')
            new_profile.create()
            self.profile_obj = new_profile
            self['profile_id'] = new_profile.get('id')

        return self.profile_obj
コード例 #3
0
 def testCreate(self):
     profile = Profile(ProfileTest.conn)
     profile['advertiser_id'] = 136402
     profile['deal_targets'] = [{'id': 1999}]
     profile['domain_targets'] = [{'domain': 'www.espn.com'}]
     result = profile.create()
     assert result == profile.get('id')
コード例 #4
0
 def testCreate(self):
     profile = Profile(ProfileTest.conn)
     profile['advertiser_id'] = 136402
     profile['deal_targets'] = [{'id': 1999}]
     profile['domain_targets'] = [{'domain': 'www.espn.com'}]
     result = profile.create()
     assert result == profile.get('id')