Commits

Anonymous committed 2752d8b

Excluded fields can be defered

Comments (0)

Files changed (1)

piston/handler.py

     def __init__(self, model=None):
         if model:
             self.model = model
+        self.defer = self.exclude
         return super(BaseHandler, self).__init__()
 
     def flatten_dict(self, dct):
 
     def queryset(self, request):
         # In the future, request can be used to limit the records the user can retrieve
-        return self.model.objects.all()
+        return self.model.objects.all().defer(*self.defer)
 
     def value_from_tuple(tu, name):
         for int_, n in tu: