PromotionWeights.get_campaigns can filter by sr_name.

This commit is contained in:
Brian Simpson
2013-10-18 01:33:43 -04:00
parent 0dce9b97a7
commit c48b98554f

View File

@@ -416,7 +416,7 @@ class PromotionWeights(Sessionized, Base):
item._delete()
@classmethod
def get_campaigns(cls, start, end=None, author_id=None):
def get_campaigns(cls, start, end=None, author_id=None, sr_name=None):
start = to_date(start)
q = cls.query()
if end:
@@ -427,7 +427,10 @@ class PromotionWeights(Sessionized, Base):
if author_id:
q = q.filter(cls.account_id == author_id)
if sr_name:
q = q.filter(cls.sr_name == sr_name)
return list(q)
@classmethod