Commit 94737c50 authored by Ashish's avatar Ashish
Browse files

Change to use read-only router for data-apis

parent fd9920ab
...@@ -4,7 +4,7 @@ Build dynamic API based on the provided SQLAlchemy model ...@@ -4,7 +4,7 @@ Build dynamic API based on the provided SQLAlchemy model
""" """
from managers import AlchemyModelManager from managers import AlchemyModelManager
from viewsets import AlchemyModelViewSet from viewsets import AlchemyModelViewSet
from rest_framework_nested import routers from routers import ReadOnlyRouter
class APIModelBuilder(object): class APIModelBuilder(object):
...@@ -27,7 +27,7 @@ class APIModelBuilder(object): ...@@ -27,7 +27,7 @@ class APIModelBuilder(object):
@property @property
def urls(self): def urls(self):
router = routers.SimpleRouter() router = ReadOnlyRouter()
for model in self.models: for model in self.models:
manager = type( manager = type(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment