Ticket #16299: support-for-unicode-literals.diff
File support-for-unicode-literals.diff, 1.2 KB (added by , 13 years ago) |
---|
-
django/db/models/options.py
385 385 cache[obj] = model 386 386 for klass in get_models(include_auto_created=True, only_installed=False): 387 387 for f in klass._meta.local_fields: 388 if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:388 if f.rel and not isinstance(f.rel.to, (str, unicode)) and self == f.rel.to._meta: 389 389 cache[RelatedObject(f.rel.to, klass, f)] = None 390 390 self._related_objects_cache = cache 391 391 … … 422 422 cache[obj] = model 423 423 for klass in get_models(only_installed=False): 424 424 for f in klass._meta.local_many_to_many: 425 if f.rel and not isinstance(f.rel.to, str) and self == f.rel.to._meta:425 if f.rel and not isinstance(f.rel.to, (str, unicode)) and self == f.rel.to._meta: 426 426 cache[RelatedObject(f.rel.to, klass, f)] = None 427 427 if app_cache_ready(): 428 428 self._related_many_to_many_cache = cache