Re: Add an optional parameter to values() that returns a nested dictionary for foreign keys

2015-11-25 Thread Moenad
n name", > "country": { > "id": 3, > "name": "country name" > } > }, > "father": 4 > } > > > (here, "father" is another FK that we don't want expanded ? > > May

Re: Add an optional parameter to values() that returns a nested dictionary for foreign keys

2015-11-25 Thread Moenad
ld something like this be possible by allowing > expressions in values() and using custom output fields? > > On Wednesday, November 25, 2015 at 5:09:29 PM UTC+1, Moenad wrote: >> >> Well, switch the field name aliasing to a dictionary without hijacking >> **kwargs ? &g

Re: Add an optional parameter to values() that returns a nested dictionary for foreign keys

2015-11-25 Thread Moenad
ing of keys, instead of using the database column names. >> 2) Allow callbacks functions (or lambdas) to convert output values to >> another format if needed. >> >> With this, I could send the queries results right to JSON outputs. >> >> -bobby >> >>

Re: Add an optional parameter to values() that returns a nested dictionary for foreign keys

2015-11-25 Thread Moenad
of using the database column names. > 2) Allow callbacks functions (or lambdas) to convert output values to > another format if needed. > > With this, I could send the queries results right to JSON outputs. > > -bobby > > On Nov 25, 2015, at 9:05 AM, Moenad > > wrote: >

Add an optional parameter to values() that returns a nested dictionary for foreign keys

2015-11-25 Thread Moenad
Currently, after calling values() and the query executes, the output is a single level dictionary, including foreign keys. I propose adding an extra parameter for values, or at least values_list, where if it's set to true, a nested dictionary will be returned when there's a foreign key. Example