I’ve used a raw SQL Query to access them, and it seems to have worked. However, I can’t figure out a way to actually print the results to an array. The only thing that I can find is the cursor.fetchone() command, which gives me a single row.
Is there any way that I can return an entire column in a django query set?
dict(MyModel.objects.values_list('id', 'my_column'))will return a dictionary with all elements ofmy_columnwith the row’s id as the key. But probably you’re just looking for a list of all the values, which you should receive viaMyModel.objects.values_list('my_column', flat=True)!