Skip to content

Commit

Permalink
Add scheme statement serializers, views
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Oct 30, 2024
1 parent 3e279bd commit d8e4056
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
20 changes: 16 additions & 4 deletions arches_lingo/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
ConceptStatementListCreateView,
SchemeDetailView,
SchemeListCreateView,
SchemeStatementDetailView,
SchemeStatementListCreateView,
)

urlpatterns = [
Expand All @@ -25,17 +27,27 @@
path("api/concepts", ConceptListCreateView.as_view(), name="concepts-list-create"),
path("api/concept/<uuid:pk>", ConceptDetailView.as_view(), name="concept-detail"),
path(
"api/statements",
"api/concept/statements",
ConceptStatementListCreateView.as_view(),
name="statements-list-create",
name="concept-statements-list-create",
),
path(
"api/statement/<uuid:pk>",
"api/concept/statement/<uuid:pk>",
ConceptStatementDetailView.as_view(),
name="statement-detail",
name="concept-statement-detail",
),
path("api/schemes", SchemeListCreateView.as_view(), name="schemes-list-create"),
path("api/scheme/<uuid:pk>", SchemeDetailView.as_view(), name="scheme-detail"),
path(
"api/scheme/statements",
SchemeStatementListCreateView.as_view(),
name="scheme-statements-list-create",
),
path(
"api/scheme/statement/<uuid:pk>",
SchemeStatementDetailView.as_view(),
name="scheme-statement-detail",
),
path("", include("arches_references.urls")),
]

Expand Down
11 changes: 11 additions & 0 deletions arches_lingo/views/api/pythonic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
ConceptSerializer,
SchemeSerializer,
ConceptStatementSerializer,
SchemeStatementSerializer,
)


Expand All @@ -20,6 +21,16 @@ class SchemeDetailView(ArchesModelAPIMixin, RetrieveUpdateDestroyAPIView):
serializer_class = SchemeSerializer


class SchemeStatementListCreateView(ArchesModelAPIMixin, ListCreateAPIView):
permission_classes = [IsAuthenticated]
serializer_class = SchemeStatementSerializer


class SchemeStatementDetailView(ArchesModelAPIMixin, RetrieveUpdateDestroyAPIView):
permission_classes = [IsAuthenticated]
serializer_class = SchemeStatementSerializer


class ConceptListCreateView(ArchesModelAPIMixin, ListCreateAPIView):
permission_classes = [IsAuthenticated]
serializer_class = ConceptSerializer
Expand Down

0 comments on commit d8e4056

Please sign in to comment.