mirror of
https://github.com/django/django.git
synced 2025-09-18 08:20:10 +00:00
parent
f8bb8436e5
commit
1101467ce0
112 changed files with 1239 additions and 412 deletions
|
@ -114,7 +114,8 @@ def lazy(func, *resultclasses):
|
|||
setattr(cls, k, meth)
|
||||
cls._delegate_bytes = bytes in resultclasses
|
||||
cls._delegate_text = six.text_type in resultclasses
|
||||
assert not (cls._delegate_bytes and cls._delegate_text), "Cannot call lazy() with both bytes and text return types."
|
||||
assert not (cls._delegate_bytes and cls._delegate_text), (
|
||||
"Cannot call lazy() with both bytes and text return types.")
|
||||
if cls._delegate_text:
|
||||
if six.PY3:
|
||||
cls.__str__ = cls.__text_cast
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue