Ticket #2409: generic.diff
| File generic.diff, 688 bytes (added by cleverdevil, 2 years ago) |
|---|
-
tg/jsonify.py
diff -r 62c3c2c378b4 tg/jsonify.py
a b 36 36 else: 37 37 return JSONEncoder.default(self, obj) 38 38 39 _instance = GenericJSON() 39 40 # Generic Function JSON Encoder class 41 42 try: 43 from simplegeneric import generic 44 45 _default = GenericJSON() 46 47 @generic 48 def jsonify(obj): 49 return _default.default(obj) 50 51 class GenericFunctionJSON(GenericJSON): 52 def default(self, obj): 53 return jsonify(obj) 54 55 _instance = GenericFunctionJSON() 56 except ImportError: 57 _instance = GenericJSON() 40 58 41 59 42 60 # General encoding functions