from radar_api.serializers.consultants import ConsultantSerializer
from radar.views.core import ListModelView, RetrieveModelView
from radar.models import Consultant


class ConsultantListView(ListModelView):
    serializer_class = ConsultantSerializer
    model_class = Consultant


class ConsultantDetailView(RetrieveModelView):
    serializer_class = ConsultantSerializer
    model_class = Consultant


def register_views(app):
    app.add_url_rule('/consultants', view_func=ConsultantListView.as_view('consultant_list'))
    app.add_url_rule('/consultants/<int:id>', view_func=ConsultantDetailView.as_view('consultant_detail'))

@@ -89,24 +89,30 @@
  import List
+Create
 ModelView, R
@@ -110,32 +110,45 @@
 elView, Retrieve
+UpdateDestroy
 ModelView%0Afrom r
@@ -169,32 +169,78 @@
 port Consultant%0A
+from radar.permissions import AdminPermission%0A
 %0A%0Aclass Consulta
@@ -254,16 +254,22 @@
 iew(List
+Create
 ModelVie
@@ -345,16 +345,59 @@
 sultant%0A
+    permission_classes = %5BAdminPermission%5D%0A
 %0A%0Aclass 
@@ -425,16 +425,29 @@
 Retrieve
+UpdateDestroy
 ModelVie
@@ -523,16 +523,59 @@
 sultant%0A
+    permission_classes = %5BAdminPermission%5D%0A
 %0A%0Adef re

Add consultants page