fixed no-cls-argument on staticmethod __new__

This commit is contained in:
mehrab 2019-10-01 23:16:27 +03:30
parent 0dac98d215
commit f118cfd9bc
2 changed files with 4 additions and 4 deletions

View File

@ -1764,8 +1764,8 @@ class JSONField(Field):
# When HTML form input is used, mark up the input
# as being a JSON string, rather than a JSON primitive.
class JSONString(str):
def __new__(self, value):
ret = str.__new__(self, value)
def __new__(cls, value):
ret = str.__new__(cls, value)
ret.is_json_string = True
return ret
return JSONString(dictionary[self.field_name])

View File

@ -46,8 +46,8 @@ class Hyperlink(str):
We use this for hyperlinked URLs that may render as a named link
in some contexts, or render as a plain URL in others.
"""
def __new__(self, url, obj):
ret = str.__new__(self, url)
def __new__(cls, url, obj):
ret = str.__new__(cls, url)
ret.obj = obj
return ret