Skip to content

Commit

Permalink
change files structure and import statemets
Browse files Browse the repository at this point in the history
  • Loading branch information
pkujawa committed Jul 9, 2024
1 parent 0f76baf commit 2d57cf1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 22 deletions.
1 change: 0 additions & 1 deletion backend/hct_mis_api/api/endpoints/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from hct_mis_api.api.endpoints.core import * # noqa: F401, F403
from hct_mis_api.api.endpoints.lookups import * # noqa: F401, F403
from hct_mis_api.api.endpoints.program import * # noqa: F401, F403
from hct_mis_api.api.endpoints.rdi import * # noqa: F401, F403
4 changes: 1 addition & 3 deletions backend/hct_mis_api/api/endpoints/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
from hct_mis_api.api.endpoints.core.business_area import ( # noqa: F401
BusinessAreaListView,
)
from hct_mis_api.api.endpoints.core.views import BusinessAreaListView # noqa: F401
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from rest_framework import serializers
from rest_framework.generics import ListAPIView

from hct_mis_api.api.endpoints.base import HOPEAPIView
from hct_mis_api.apps.core.models import BusinessArea


Expand All @@ -18,8 +16,3 @@ class Meta:
"is_split",
"active",
)


class BusinessAreaListView(HOPEAPIView, ListAPIView):
serializer_class = BusinessAreaSerializer
queryset = BusinessArea.objects.all()
10 changes: 10 additions & 0 deletions backend/hct_mis_api/api/endpoints/core/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from rest_framework.generics import ListAPIView

from hct_mis_api.api.endpoints.base import HOPEAPIView
from hct_mis_api.api.endpoints.core.serializers import BusinessAreaSerializer
from hct_mis_api.apps.core.models import BusinessArea


class BusinessAreaListView(HOPEAPIView, ListAPIView):
serializer_class = BusinessAreaSerializer
queryset = BusinessArea.objects.all()
3 changes: 0 additions & 3 deletions backend/hct_mis_api/api/endpoints/program/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from hct_mis_api.api.endpoints.program.program import ( # noqa: F401
ProgramGlobalListView,
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from rest_framework import serializers
from rest_framework.generics import ListAPIView

from hct_mis_api.api.endpoints.base import HOPEAPIView
from hct_mis_api.apps.program.models import Program


Expand All @@ -25,8 +23,3 @@ class Meta:
"population_goal",
"business_area_code",
)


class ProgramGlobalListView(HOPEAPIView, ListAPIView):
serializer_class = ProgramGlobalSerializer
queryset = Program.objects.all()
10 changes: 10 additions & 0 deletions backend/hct_mis_api/api/endpoints/program/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from rest_framework.generics import ListAPIView

from hct_mis_api.api.endpoints.base import HOPEAPIView
from hct_mis_api.api.endpoints.program.serializers import ProgramGlobalSerializer
from hct_mis_api.apps.program.models import Program


class ProgramGlobalListView(HOPEAPIView, ListAPIView):
serializer_class = ProgramGlobalSerializer
queryset = Program.objects.all()
3 changes: 2 additions & 1 deletion backend/hct_mis_api/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from hct_mis_api.api import endpoints
from hct_mis_api.api.endpoints.base import ConstanceSettingsAPIView
from hct_mis_api.api.endpoints.program.views import ProgramGlobalListView
from hct_mis_api.api.router import APIRouter

app_name = "api"
Expand Down Expand Up @@ -36,7 +37,7 @@
path("lookups/role/", endpoints.lookups.Roles().as_view(), name="role-list"),
path("lookups/sex/", endpoints.lookups.Sex().as_view(), name="sex-list"),
path("business_areas/", endpoints.core.BusinessAreaListView.as_view(), name="business-area-list"),
path("programs/", endpoints.program.ProgramGlobalListView.as_view(), name="program-global-list"),
path("programs/", ProgramGlobalListView.as_view(), name="program-global-list"),
path(
"<slug:business_area>/",
include(
Expand Down

0 comments on commit 2d57cf1

Please sign in to comment.