This file contains 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
SERVE_MEDIA = DEBUG |
This file contains 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
LOGGING = { | |
"version": 1, | |
"disable_existing_loggers": True, | |
"handlers": { | |
"mail_admins": { | |
"level": "ERROR", | |
"class": "django.utils.log.AdminEmailHandler" | |
}, | |
}, | |
"loggers": { |
This file contains 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.db.models import get_apps, get_app | |
from django.utils import unittest | |
from django.test.simple import build_test, build_suite, reorder_suite | |
from django.test.simple import DjangoTestSuiteRunner | |
from django.test.testcases import TestCase | |
class ExclusionTestSuiteRunner(DjangoTestSuiteRunner): | |
This file contains 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
# There are other ways of handling this of course. This could all go into a Formset. | |
# Another question is should we accept one form being submitted and the other not? | |
# This is just one possible implementation of a Multi Form Mixin that requires Both forms. | |
# You could adapt it to work for allowing processing of any forms by modifying the post method | |
# of MultiProcessFormView. | |
# In general I don't think a view like this is useful. More than one kind of form shouldn't, | |
# in my opinion, be submitting to the exact same url. And if you need to include an additional | |
# form on a page that POST's elsewhere than a simple override of get_context_data would | |
# be a better option. This keeps your views focuses on their task while still allowing you |
This file contains 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.db.models.loading import cache | |
REAL_LOAD_APP = cache.load_app | |
def _load_app(app, *args, **kwargs): | |
r = REAL_LOAD_APP(app, *args, **kwargs) | |
# @@@ This is Really Hacky |
This file contains 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
// While you can edit this file, it's generally best to put your changes in | |
// "User/Base File.sublime-settings", which overrides the settings in here. | |
// | |
// Settings may also be placed in file type specific options files, for example, | |
// in Packages/Python/Python.sublime-settings for python files. | |
{ | |
// Sets the colors used within the text area | |
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
// Note that the font_face and font_size are overriden in the platform |
This file contains 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
class A(object): | |
pass | |
class B(object): | |
pass | |
class C(object): | |
pass | |
class CandB(C, B): |
This file contains 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
# | |
# Taken from http://justcramer.com/2010/12/06/tracking-changes-to-fields-in-django/ | |
# | |
def track_data(*fields): | |
""" | |
Tracks property changes on a model instance. | |
The changed list of properties is refreshed on model initialization | |
and save. |
This file contains 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
import uuid | |
from django.core.exceptions import ImproperlyConfigured | |
from django.db import models | |
try: | |
import psycopg2.extras | |
psycopg2.extras.register_uuid() | |
except ImportError: | |
raise ImproperlyConfigured("UUIDField currently only support PostgreSQL and the psycopg2 interface.") |
This file contains 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
# Brain-dead errors regarding standard language features | |
# W0142 = *args and **kwargs support | |
# W0403 = Relative imports | |
# Pointless whinging | |
# R0201 = Method could be a function | |
# W0212 = Accessing protected attribute of client class | |
# W0613 = Unused argument | |
# W0232 = Class has no __init__ method | |
# R0901 = Too Many Ancestors |