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

Commit 774e4fb

Browse files
committed
Add SspSuspicious model
1 parent f3902d6 commit 774e4fb

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
* :class:`atomx.models.Dsp`
1212
* :class:`atomx.models.Ssp`
13+
* :class:`atomx.models.SspSuspicious`
1314
* :class:`atomx.models.SspResultType`
1415

1516

atomx/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'Datacenter', 'DeviceType', 'Domain', 'Dma', 'Dsp', 'Fallback', 'Isp', 'Languages', 'Network',
2323
'OperatingSystem', 'Placement', 'PlacementType', 'PriceModel', 'Profile', 'Publisher',
2424
'Reason', 'Report', 'Segment', 'SellerProfile', 'Site', 'Size', 'Ssp', 'SspResultType',
25-
'Timezone', 'User', 'Visibility', 'Zipcode'] # noqa
25+
'SspSuspicious', 'Timezone', 'User', 'Visibility', 'Zipcode'] # noqa
2626

2727

2828
class AtomxModel(object):

atomx/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def get_model_name(name):
3636
model_name = name.capitalize()
3737

3838
if model_name.endswith('ies'): # change e.g. Countries to Countr*y*
39-
model_name = model_name[:-3]+'y'
39+
model_name = model_name[:-3] + 'y'
40+
if model_name in ['Suspicious', 'SspSuspicious']:
41+
return 'SspSuspicious'
4042
else:
4143
model_name = model_name.rstrip('s')
4244
if model_name in dir(models):
@@ -51,6 +53,8 @@ def get_attribute_model_name(attribute):
5153
:param str attribute: attribute name to convert
5254
:return: name of the model or False
5355
"""
56+
if attribute.lower() == 'suspicious':
57+
return 'SspSuspicious'
5458
return get_model_name(re.sub('(_filter|_include|_exclude)$', '', attribute))
5559

5660

0 commit comments

Comments
 (0)