mirror of
https://github.com/django/django.git
synced 2025-01-08 17:37:20 +00:00
Fix Python 3 support
This commit is contained in:
parent
48dd1e63bb
commit
904b82759c
@ -1166,7 +1166,7 @@ class ForeignKey(ForeignObject):
|
|||||||
rel = self.rel
|
rel = self.rel
|
||||||
if self.rel.field_name:
|
if self.rel.field_name:
|
||||||
kwargs['to_field'] = 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
|
kwargs['to'] = self.rel.to
|
||||||
else:
|
else:
|
||||||
kwargs['to'] = "%s.%s" % (self.rel.to._meta.app_label, self.rel.to._meta.object_name)
|
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']
|
del kwargs['help_text']
|
||||||
# Rel needs more work.
|
# Rel needs more work.
|
||||||
rel = self.rel
|
rel = self.rel
|
||||||
if isinstance(self.rel.to, basestring):
|
if isinstance(self.rel.to, six.string_types):
|
||||||
kwargs['to'] = self.rel.to
|
kwargs['to'] = self.rel.to
|
||||||
else:
|
else:
|
||||||
kwargs['to'] = "%s.%s" % (self.rel.to._meta.app_label, self.rel.to._meta.object_name)
|
kwargs['to'] = "%s.%s" % (self.rel.to._meta.app_label, self.rel.to._meta.object_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user