score:1

Accepted answer
 class AccountingPeriodsChoicesAPIView(views.APIView):


    def get(self, request, format=None):

        my_choices = []
        choice_dict = dict(ACCOUNTING_PERIODS_CHOICES)
        for key, value in choice_dict.items():

            itered_dict = {"key": key, "value": value}
            my_choices.append(itered_dict)
        return Response(my_choices, status=status.HTTP_200_OK)

score:0

"Freshman"

Related Query

More Query from same tag