MattBroach / DjangoRestMultipleModels

View (and mixin) for serializing multiple models or querysets in Django Rest Framework
MIT License
549 stars 67 forks source link

Pagination for `objectify` implementation and fix flat=True and objectify=True usage #23

Closed evgenosiptsov closed 7 years ago

evgenosiptsov commented 7 years ago

Hi, Matt!

  1. If flat and objectify params set as True, DjangoRestMultipleModels tried to append datum to the dict "result" through usage "append" method. Obviously use objectify=True and flat=True together is an incorrect approach, i've add checking this.

  2. We use pagination only for certain querysets (such as listing results) and we should't paginate additional querysets (such as filters, features for results, etc). So I see no reason to maintain our own approach for this and add it to code.

MattBroach commented 7 years ago

Hey @evgenosiptsov! Thanks for the updates. Unfortunately, I had to remove the pagination before formatting when objectify=True -- I think that might have only worked with your custom pagination, but running the queryList through pagination before formatting otherwise meant that querysets weren't being executed when objectify=True in all my tests.

The flat/objectify checks are much appreciated though!