Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Commit e17af0e

Browse files
committed
add ensure_ascii param to AsJsonString method for models
close issue #527
1 parent fa4a9ef commit e17af0e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

twitter/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ def __hash__(self):
3535
raise TypeError('unhashable type: {} (no id attribute)'
3636
.format(type(self)))
3737

38-
def AsJsonString(self):
38+
def AsJsonString(self, ensure_ascii=True):
3939
""" Returns the TwitterModel as a JSON string based on key/value
4040
pairs returned from the AsDict() method. """
41-
return json.dumps(self.AsDict(), sort_keys=True)
41+
return json.dumps(self.AsDict(), ensure_ascii=ensure_ascii, sort_keys=True)
4242

4343
def AsDict(self):
4444
""" Create a dictionary representation of the object. Please see inline

0 commit comments

Comments
 (0)