Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

django 1.10 fix #506

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions oauth2client/contrib/django_orm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
__author__ = '[email protected] (Joe Gregorio)'


class CredentialsField(six.with_metaclass(models.SubfieldBase, models.Field)):
class CredentialsField(models.Field):

def __init__(self, *args, **kwargs):
if 'null' not in kwargs:
Expand All @@ -41,6 +41,9 @@ def __init__(self, *args, **kwargs):
def get_internal_type(self):
return 'TextField'

def from_db_value(self, value, expression, connection, context):
return self.to_python(value)

def to_python(self, value):
if value is None:
return None
Expand Down Expand Up @@ -68,7 +71,7 @@ def value_to_string(self, obj):
return self.get_prep_value(value)


class FlowField(six.with_metaclass(models.SubfieldBase, models.Field)):
class FlowField(models.Field):

def __init__(self, *args, **kwargs):
if 'null' not in kwargs:
Expand All @@ -78,6 +81,9 @@ def __init__(self, *args, **kwargs):
def get_internal_type(self):
return 'TextField'

def from_db_value(self, value, expression, connection, context):
return self.to_python(value)

def to_python(self, value):
if value is None:
return None
Expand Down