Tastypie queries for all fields, is it possible to only SELECT specific fields

17 Views Asked by At

With tastypie you create a resource for your Django model and point the queryset at your model.objects.all(). I was expecting "fields" to allow me to declare which fields i want to return: https://django-tastypie.readthedocs.io/en/latest/resources.html?highlight=exclude#fields

This does work, but the sql query generated doesnt care it selects all fields. For me this seems a bit bit pointless if im querying a large table and only want to return 2 columns, and not the other 8.

Hopefully I've missed something obvious in the TP documentation. If anyone has any pointers/ideas that would be great

0

There are 0 best solutions below