Adding field for returned frappe.db.sql

Hello;

The below query is returning the values for the record of the columns idx, origin, destination, hop_price, parent, if I need to add column for the returned value “get_subsc_hops” (and not for the database table), how I can do this?

In other words, I need to be able for example to set the following value:
get_subsc_hops[1][‘description’] = “Available”
get_subsc_hops[2][‘description’] = “Not Available”

Where description field is not existed in the table tabTaxi Subscription Hops in the below query. How to achieve this?

            get_subsc_hops =  frappe.db.sql("""select idx, origin, destination, hop_price, parent from `tabTaxi Subscription Hops`
                    where parent = %s
                    order by idx asc""", (get_subscription[0]['name']), as_dict=True)

Regards
Bilal

get_subsc_hops = frappe.db.sql(""“select idx, origin, destination, hop_price, parent, null as description from tabTaxi Subscription Hops
where parent = %s
order by idx asc”"", (get_subscription[0][‘name’]), as_dict=True)

1 Like

Yes, and another method that I found it was:

get_subsc_hops[i]['description'] where i is the row number.

Thank you a lot.
Regards
Bilal