o***@gmail.com
2018-08-01 10:49:41 UTC
how to solve this error?
class error:
def __init__(self):
self.errorCode="server issue"
self.errorMessage="201"
class BaseRespone():
def __init__(self):
self.success = "data fetch successfully"
self.data
<http://disq.us/url?url=http%3A%2F%2Fself.data%3AKodzQoyqQo3rt1_ddERBA0lp294&cuid=5003970>
={"succss":"msg"}
self.error1 = error()
bs = BaseRespone()
json_string = json.dumps(bs.__dict__)
json_string1= json.loads(json_string)
after executing this code i am gettig this code
TypeError: Object of type 'error' is not JSON serializable
class error:
def __init__(self):
self.errorCode="server issue"
self.errorMessage="201"
class BaseRespone():
def __init__(self):
self.success = "data fetch successfully"
self.data
<http://disq.us/url?url=http%3A%2F%2Fself.data%3AKodzQoyqQo3rt1_ddERBA0lp294&cuid=5003970>
={"succss":"msg"}
self.error1 = error()
bs = BaseRespone()
json_string = json.dumps(bs.__dict__)
json_string1= json.loads(json_string)
after executing this code i am gettig this code
TypeError: Object of type 'error' is not JSON serializable
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.