Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

Commit b6261e7

Browse files
committed
bugfix: lazy load attributes that are CamelCase
1 parent 26aeef4 commit b6261e7

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGES.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
- Add new models:
88

99
* :class:`atomx.models.AccountManager` (alias for `User`)
10-
* :class:`atomx.models.PlacementType`
1110
* :class:`atomx.models.CampaignDebugReason`
11+
* :class:`atomx.models.CreativeAttribute`
12+
* :class:`atomx.models.PlacementType`
1213
* :class:`atomx.models.Visibility`
1314

1415
- Add :meth:`atomx.models.ScheduledReport.save` to edit ``name`` and ``emails``

atomx/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
NoPandasInstalledError,
1818
)
1919

20-
__all__ = ['AccountManager', 'Advertiser', 'Bidder', 'Browser', 'CampaignDebugReason',
21-
'Campaign', 'Category', 'ConnectionType', 'ConversionPixel', 'Country', 'Creative',
20+
__all__ = ['AccountManager', 'Advertiser', 'Bidder', 'Browser',
21+
'CampaignDebugReason', 'Campaign', 'Category', 'ConnectionType',
22+
'ConversionPixel', 'Country', 'Creative', 'CreativeAttribute',
2223
'Datacenter', 'DeviceType', 'Domain', 'Fallback', 'Isp', 'Languages', 'Network',
2324
'OperatingSystem', 'Placement', 'PlacementType', 'Profile', 'Publisher', 'Reason',
2425
'Segment', 'SellerProfile', 'Site', 'Size', 'User', 'Visibility']
@@ -66,8 +67,7 @@ def __getattr__(self, item):
6667
# try to load model attribute from server if possible
6768
if not item.startswith('_') and item not in self._attributes and self.session:
6869
try:
69-
v = self.session.get(self.__class__.__name__ + '/' +
70-
str(self.id) + '/' + str(item))
70+
v = self.session.get(self.__class__._resource_name, self.id, item)
7171
self._attributes[item] = v
7272
except APIError as e:
7373
raise AttributeError(e)

0 commit comments

Comments
 (0)