urlpatterns = [
...
path('incoming-calls/', incoming_calls.IncomingCallsReport.as_view(), name='incoming-calls'),
...
]
incoming_calls.py
class IncomingCallsReport(APIView):
select_fields = ["uniqueid", "enterdate"]
def __init__(self):
show_contact_details = settings.SHOW_CONTACT_DETAILS
if show_contact_details:
for i in range(11):
self.select_fields.append("custom{}".format(i + 1))
def post(self, request):
...
return Response(status=200)
With the code above, every time I make a POST to incoming-calls/, the field select_fields gets 10 new custom fields, and that's not the idea