Created
August 20, 2015 21:36
-
-
Save Telling/8c222378db09068c3d81 to your computer and use it in GitHub Desktop.
sort by yeah, month on wierd string
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
@property | |
def by_year_month(self): | |
""" Sorts the list, and returns it sorted by year and month. | |
""" | |
self.webalizer_months.sort( | |
key=lambda x: (int(x.split(' ', 1)[0]), int(x.split(' ', 2)[1])) | |
) | |
return self.webalizer_months |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment