equal
deleted
inserted
replaced
234 elif util.safehasattr(obj, '__iter__'): |
234 elif util.safehasattr(obj, '__iter__'): |
235 out = [] |
235 out = [] |
236 for i in obj: |
236 for i in obj: |
237 out.append(json(i)) |
237 out.append(json(i)) |
238 return '[' + ', '.join(out) + ']' |
238 return '[' + ', '.join(out) + ']' |
239 elif util.safehasattr(obj, '__call__'): |
|
240 return json(obj()) |
|
241 else: |
239 else: |
242 raise TypeError('cannot encode type %s' % obj.__class__.__name__) |
240 raise TypeError('cannot encode type %s' % obj.__class__.__name__) |
243 |
241 |
244 @templatefilter('lower') |
242 @templatefilter('lower') |
245 def lower(text): |
243 def lower(text): |