What about introspecting the model associated with the QuerySet:

qs = SomeModel.objects.all()
columns = [f.column for f in qs.model._meta.fields]

Regards, Michael


Am 04.07.2020 um 22:11 schrieb Eugene Kulak:
How to get names of columns from QuerySet without executing it?
If it is not possible what would be the most easier way to execute a lighter version of the query.
The query itself is unknown, it could be anything.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2792dd62-5266-6b75-6237-769157298bd2%40fladi.at.

Reply via email to