This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FieldSelectMixin(object): | |
""" | |
Mixin to allow field selection. | |
This has to be done in two parts: | |
1) In model queryset for database selection. This need to be in some code section | |
where the queryset is ready, but still not evaluated. obj_get_list and obj_get are perfect | |
for Tastypie GET requests. | |
2) In full_dehydrate method, to prevent from Tastypie fetching all the fields from the model. | |
""" | |
def full_dehydrate(self, bundle, for_list=False): |