From 904b82759cce6f85d06564c42123da030da52341 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Fri, 28 Jun 2013 17:53:49 +0100 Subject: [PATCH] Fix Python 3 support --- django/db/models/fields/related.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index c708bff49f..1ad4bf4706 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -1166,7 +1166,7 @@ class ForeignKey(ForeignObject): rel = self.rel if self.rel.field_name: kwargs['to_field'] = self.rel.field_name - if isinstance(self.rel.to, basestring): + if isinstance(self.rel.to, six.string_types): kwargs['to'] = self.rel.to else: kwargs['to'] = "%s.%s" % (self.rel.to._meta.app_label, self.rel.to._meta.object_name) @@ -1393,7 +1393,7 @@ class ManyToManyField(RelatedField): del kwargs['help_text'] # Rel needs more work. rel = self.rel - if isinstance(self.rel.to, basestring): + if isinstance(self.rel.to, six.string_types): kwargs['to'] = self.rel.to else: kwargs['to'] = "%s.%s" % (self.rel.to._meta.app_label, self.rel.to._meta.object_name)