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 default_3way_compare(v, w): # Yes, this is how Python 2 sorted things :) | |
| if type(v) is type(w): | |
| return -1 if id(v) < id(w) else (1 if id(v) > id(w) else 0) | |
| if v is None: | |
| return -1 | |
| if w is None: | |
| return 1 | |
| if isinstance(v, (int, float)): | |
| vname = '' | |
| else: |
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
| September 2008 1.0 2.3, 2.4, 2.5, 2.6 | |
| July 2009 1.1 2.3, 2.4, 2.5, 2.6 | |
| May 2010 1.2 2.4, 2.5, 2.6, 2.7 | |
| March 2011 1.3 2.4, 2.5, 2.6, 2.7 | |
| March 2012 1.4 2.5, 2.6, 2.7 | |
| Feburary 2013 1.5 2.6, 2.7 and 3.2, 3.3 (experimental) | |
| November 2013 1.6 2.6, 2.7 and 3.2, 3.3 | |
| September 2014 1.7 2.7 and 3.2, 3.3, 3.4 | |
| April 2015? 1.8 2.7 and 3.2, 3.3, 3.4 | |
| November 2015? 1.9 2.7 and 3.3, 3.4, 3.5 |
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
| from django.conf import settings | |
| from django.core.mail.backends.smtp import EmailBackend as SmtpEmailBackend | |
| class CustomEmailBackend(SmtpEmailBackend): | |
| def _send(self, email_message): | |
| if not email_message.recipients(): | |
| return False | |
| message = email_message.message() | |
| try: |
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
| # in my settings_local.py | |
| import datetime | |
| import logging | |
| from django.http import HttpRequest | |
| class TimingHandler(logging.Handler): | |
| def __init__(self, *args, **kwargs): |
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 default_3way_compare(v, w): # Yes, this is how Python 2 sorted things :) | |
| tv, tw = type(v), type(w) | |
| if tv is tw: | |
| return -1 if id(v) < id(w) else (1 if id(v) > id(w) else 0) | |
| if v is None: | |
| return -1 | |
| if w is None: | |
| return 1 | |
| if isinstance(v, (int, float)): | |
| vname = '' |
OlderNewer