Show More
@@ -219,8 +219,12 b' def indent(text, prefix):' | |||
|
219 | 219 | |
|
220 | 220 | @templatefilter('json') |
|
221 | 221 | def json(obj): |
|
222 | if obj is None or obj is False or obj is True: | |
|
223 | return {None: 'null', False: 'false', True: 'true'}[obj] | |
|
222 | if obj is None: | |
|
223 | return 'null' | |
|
224 | elif obj is False: | |
|
225 | return 'false' | |
|
226 | elif obj is True: | |
|
227 | return 'true' | |
|
224 | 228 | elif isinstance(obj, (int, long, float)): |
|
225 | 229 | return str(obj) |
|
226 | 230 | elif isinstance(obj, str): |
General Comments 0
You need to be logged in to leave comments.
Login now