Ticket #6045: related.py.patch
File related.py.patch, 1.2 KB (added by , 14 years ago) |
---|
-
django/db/models/fields/related.py
old new 7 7 from django.db.models.related import RelatedObject 8 8 from django.db.models.query import QuerySet 9 9 from django.db.models.query_utils import QueryWrapper 10 from django.utils.encoding import smart_unicode 10 from django.utils.encoding import smart_unicode, smart_str 11 11 from django.utils.translation import ugettext_lazy as _, string_concat, ungettext, ugettext 12 12 from django.utils.functional import curry 13 13 from django.core import exceptions … … 467 467 join_table=None, source_field_name=None, target_field_name=None, 468 468 reverse=False): 469 469 super(ManyRelatedManager, self).__init__() 470 self.core_filters = core_filters 470 471 self.core_filters = {} 472 if core_filters: 473 for key, value in core_filters.items(): 474 if not isinstance(key, str): 475 key = smart_str(key) 476 self.core_filters[key] = value 477 471 478 self.model = model 472 479 self.symmetrical = symmetrical 473 480 self.instance = instance