Ticket #6045: patch.diff
File patch.diff, 1.3 KB (added by , 16 years ago) |
---|
-
db/models/fields/related.py
4 4 from django.db.models.related import RelatedObject 5 5 from django.db.models.query import QuerySet 6 6 from django.db.models.query_utils import QueryWrapper 7 from django.utils.encoding import smart_unicode 7 from django.utils.encoding import smart_unicode, smart_str 8 8 from django.utils.translation import ugettext_lazy, string_concat, ungettext, ugettext as _ 9 9 from django.utils.functional import curry 10 10 from django.core import exceptions … … 362 362 def __init__(self, model=None, core_filters=None, instance=None, symmetrical=None, 363 363 join_table=None, source_col_name=None, target_col_name=None): 364 364 super(ManyRelatedManager, self).__init__() 365 self.core_filters = core_filters 365 self.core_filters = {} 366 if core_filters: 367 for key, value in core_filters.items(): 368 if not isinstance(key, str): 369 key = smart_str(key) 370 self.core_filters[key] = value 366 371 self.model = model 367 372 self.symmetrical = symmetrical 368 373 self.instance = instance