0

Here is a very good description on how to implement model-less views with django-rest-framework.

How can we do the same with the dynamic-rest extension the the django-rest-framework?

blueFast
  • 41,341
  • 63
  • 198
  • 344
  • DRF is all about optimizing Django's query performance, so without more information I'm not sure this makes obvious sense... – thebjorn Nov 08 '18 at 07:26
  • @thebjorn: DRF is not only about db access, but also about providing a normalized REST interface: standard way of doing filtering, urls, pagination, an API UI, documentation, ... DB access is just one of the features covered by drf (and it is actually mostly based on django core functionality). In my specific case, I want to make use of DRF features (**and** dynamic rest, that's why I am asking), but the data at a specific endpoint is not backed by a database, but computed. I want to offer read capabilities to this data within the context of drf/dynamic-rest. – blueFast Nov 08 '18 at 07:35
  • @thebjorn: besides, the link I provided provides an example of a usecase when would you want to use DRF without database-backed data (in-memory data). Other use cases would include data computed from other DB models (as is my case), or data collected from other services via REST interfaces. – blueFast Nov 08 '18 at 07:40
  • Sorry, I meant Dynamic Rest when I said DRF (it's early still..). – thebjorn Nov 08 '18 at 08:07
  • @thebjorn: well, then not really. :) Dynamic REST is intended to provide "Dynamic API extensions for Django REST Framework". It is an interface spec, for both URL and json responses, including paginationg, filtering, sorting, ... It is not related to DB access per-se. The base classes are not tied to database models. – blueFast Nov 08 '18 at 08:41
  • @thebjorn: to more clearly define responsibilites: DRF provides a server-side framework to implement generic REST interfaces. Dynamic REST defines a specific interface on top of DRF. – blueFast Nov 08 '18 at 08:43

0 Answers0