mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 16:40:03 +03:00
ErrorDetails implementation
This commit is contained in:
parent
d1b8511f91
commit
bf53e08f0f
|
@ -91,13 +91,18 @@ class ErrorDetail(str):
|
|||
return not self.__eq__(other)
|
||||
|
||||
def __repr__(self):
|
||||
base = 'ErrorDetail(string=%r, code=%r' % (
|
||||
if self.params:
|
||||
return 'ErrorDetail(string=%r, code=%r, params=%s)' % (
|
||||
str(self),
|
||||
self.code,
|
||||
self.params
|
||||
)
|
||||
|
||||
return 'ErrorDetail(string=%r, code=%r)' % (
|
||||
str(self),
|
||||
self.code,
|
||||
)
|
||||
|
||||
return base + ', params=%r)' % self.params if self.params else base + ')'
|
||||
|
||||
def __hash__(self):
|
||||
return hash(str(self))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user