From the django project web site, I am trying to implement the following code and have it spit out the dictionary form of the sql.
Does anyone have an example of how this is done.
When I execute the 2 lines below I retrieve the following
<RawQuerySet: 'SELECT first_name AS first, last_name AS last FROM person'>
Does anyone have an example so that I can get this into a dictionary format so that I can send it back to the web page for consumption?
>>> name_map = {'first': 'first_name', 'last': 'last_name', 'bd': 'birth_date', 'pk': 'id'}
>>> Person.objects.raw('SELECT * FROM some_other_table', translations=name_map)