MattBroach / DjangoRestMultipleModels

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

Can I using it in modelviewset? #53

Closed lyquita closed 2 years ago

lyquita commented 3 years ago

I just noticed it's kind of api view tool.

MattBroach commented 2 years ago

I think it wouldn't make sense to use this in a ModelViewSet, since the point of the ModelViewSet is to automatically generate a viewset based on a model and a serializer. The DjangoRestMultipleModels mixins bypass all of the steps under the hood that do that kind of automagic viewset generation, so you wouldn't be gaining any of the benefits of using a ModelViewSet.

Also, as pointed out in another issue, the create and update methods for a queryList are currently undefined, so this could lead to some wonky or broken behavior when integrating this library into a ModelViewSet.