Default to null=True for Django Fields.
Fixes issue #161.
Reviewed in http://codereview.appspot.com/6448098/
diff --git a/oauth2client/django_orm.py b/oauth2client/django_orm.py
index f9ce26d..d54d20c 100644
--- a/oauth2client/django_orm.py
+++ b/oauth2client/django_orm.py
@@ -31,6 +31,11 @@
__metaclass__ = models.SubfieldBase
+ def __init__(self, *args, **kwargs):
+ if 'null' not in kwargs:
+ kwargs['null'] = True
+ super(CredentialsField, self).__init__(*args, **kwargs)
+
def get_internal_type(self):
return "TextField"
@@ -51,6 +56,11 @@
__metaclass__ = models.SubfieldBase
+ def __init__(self, *args, **kwargs):
+ if 'null' not in kwargs:
+ kwargs['null'] = True
+ super(FlowField, self).__init__(*args, **kwargs)
+
def get_internal_type(self):
return "TextField"
diff --git a/samples/django_sample/settings.py b/samples/django_sample/settings.py
index df10f0a..ceb4b29 100644
--- a/samples/django_sample/settings.py
+++ b/samples/django_sample/settings.py
@@ -10,12 +10,12 @@
MANAGERS = ADMINS
-DATABASE_ENGINE = 'sqlite3'
-DATABASE_NAME = 'database.sqlite3'
-DATABASE_USER = ''
-DATABASE_PASSWORD = ''
-DATABASE_HOST = ''
-DATABASE_PORT = ''
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': 'mydatabase'
+ }
+ }
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
@@ -53,9 +53,8 @@
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
- 'django.template.loaders.filesystem.load_template_source',
- 'django.template.loaders.app_directories.load_template_source',
-# 'django.template.loaders.eggs.load_template_source',
+ 'django.template.loaders.filesystem.Loader',
+ 'django.template.loaders.app_directories.Loader',
)
MIDDLEWARE_CLASSES = (