Tweaked Document.relations_that_doc() to accept unicode relationship strings, in order to let it be called from modules importing __future__.unicode_literals.
- Legacy-Id: 14124
This commit is contained in:
parent
9f785c0dce
commit
da23da1e8e
|
@ -4,6 +4,7 @@ import datetime
|
|||
import logging
|
||||
import os
|
||||
import rfc2html
|
||||
import six
|
||||
|
||||
from django.db import models
|
||||
from django.core import checks
|
||||
|
@ -383,7 +384,7 @@ class DocumentInfo(models.Model):
|
|||
|
||||
def relations_that_doc(self, relationship):
|
||||
"""Return the related-document objects that describe a given relationship from self to other documents."""
|
||||
if isinstance(relationship, str):
|
||||
if isinstance(relationship, six.string_types):
|
||||
relationship = [ relationship ]
|
||||
if isinstance(relationship, tuple):
|
||||
relationship = list(relationship)
|
||||
|
|
Loading…
Reference in a new issue