Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.31 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Unable to serialize datetime.datetime object in dictionary to JSON using python and trac
  2. TypeError: datetime.date(2012, 5, 23) is not JSON serializable
  3.        
  4. TypeError: date_handler() takes exactly 1 argument (2 given)
  5.        
  6. def date_handler(obj):
  7.         return obj.isoformat() if hasattr(obj, 'isoformat') else obj