Re: django cursor fetchall change datetime.datetime and decimal stamp

2015-12-23 Thread Shekar Tippur
> > I got it to work .. > def dictfetchall(cursor): "Returns all rows from a cursor as a dict" fieldnames = [name[0] for name in cursor.description] result = [] for row in cursor.fetchall(): rowset = [] for field in zip(fieldnames, row): L=list(field)

django cursor fetchall change datetime.datetime and decimal stamp

2015-12-23 Thread Shekar Tippur
Hello, I am trying to use cursor to execute a sql and convert the results to a dictionary def dictfetchall(cursor): "Return all rows from a cursor as a dict" columns = [col[0] for col in cursor.description] return [ dict(zip(columns, row)) for row in cursor.fetchall()