mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-08-03 03:40:09 +03:00
Add __repr__ to Json object for better logging
Currently, attempt to log or print Json object uses default python's implementation which is useless. Using actual serialized content is much better.
This commit is contained in:
parent
66f85b5832
commit
10feb5350d
|
@ -73,6 +73,9 @@ class Json(object):
|
|||
if proto is ISQLQuote:
|
||||
return self
|
||||
|
||||
def __repr__(self):
|
||||
return self.dumps()
|
||||
|
||||
def dumps(self, obj):
|
||||
"""Serialize *obj* in JSON format.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user