Created
December 18, 2017 12:24
-
-
Save solidpple/3c3e57296063f6d674cdd21d7da3e47d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def was_published_recently(self): | |
now = timezone.now() | |
return now - datetime.timedelta(days=1) <= self.pub_date <= now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment