-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial work for day of the week targeting #820
Conversation
Mostly just wanted initial feedback here before I finish this work up. Does this approach look reasonable? The other approach I considered was having `days` be either `weekdays` or `weekends`, which might be cleaner, but thought the flexibility was more useful of having specific days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other approach I considered was having days be either weekdays or weekends,
which might be cleaner, but thought the flexibility was more useful of having specific days.
I think this is fine and I could conceivably see advertisers skipping Fridays or Mondays or something like that.
@@ -292,6 +293,10 @@ def filter_flight(self, flight): | |||
if flight.weighted_clicks_needed_this_interval() <= 0: | |||
return False | |||
|
|||
# Skip if the flight is not meant to show on these days | |||
if not flight.show_to_day(timezone.now().strftime("%A").lower()): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess locale will always be EN_US so this should just work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. You can also get it to return an int
, and use that to map to the day, if we're worried about it.
Mostly just wanted initial feedback here before I finish this work up.
Does this approach look reasonable?
The other approach I considered was having
days
be eitherweekdays
orweekends
,which might be cleaner, but thought the flexibility was more useful of having specific days.