File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515import inspect
1616import json
1717import time
18+ from django .utils .safestring import mark_safe
1819
1920
2021__title__ = 'pyflot'
2324__license__ = 'MIT'
2425__copyright__ = 'Copyright 2011 Brian Luft'
2526
27+ def safe_json (obj ):
28+ return mark_safe (json .dumps (obj ))
29+
2630
2731def update (d , u ):
2832 """
@@ -84,7 +88,7 @@ def series_json(self):
8488 associated with this graph formatted as JSON,
8589 suitable for passing to the ``$.plot`` method.
8690 """
87- return json . dumps ([self .prepare_series (s ) for s in self ._series ])
91+ return safe_json ([self .prepare_series (s ) for s in self ._series ])
8892
8993 @property
9094 def options_json (self ):
@@ -93,7 +97,7 @@ def options_json(self):
9397 for this graph in a format suitable for passing to
9498 the ``$.plot`` method as the options parameter.
9599 """
96- return json . dumps (self ._options )
100+ return safe_json (self ._options )
97101
98102 def __getattr__ (self , value ):
99103 """
You can’t perform that action at this time.
0 commit comments