Re: __init__ method called every time on same APIView object

2019-11-01 Thread Diana María Bedoya Ramírez
Thank you very much Andréas. The program is working fine now. I didn't know the difference between those two variable types, but now I understand. On Wednesday, October 30, 2019 at 6:10:08 PM UTC-5, Diana María Bedoya Ramírez wrote: > > Hello, > > I have an APIView object with an __init__method.

Re: __init__ method called every time on same APIView object

2019-11-01 Thread Andréas Kühne
Hi, This is a python problem - You are not using an instance variable for the select_fields variable, but a class variable. If you want to use it as an instance variable you need to change the code to this: class IncomingCallsReport(APIView): def __init__(self): self.select_fields =

Re: __init__ method called every time on same APIView object

2019-10-31 Thread Diana María Bedoya Ramírez
*urls.py:* 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 = settin

Re: __init__ method called every time on same APIView object

2019-10-30 Thread Juan Pablo Romero Bernal
Hi, Show some example of code On Wed, Oct 30, 2019 at 5:08 PM Diana María Bedoya Ramírez < dbed...@ikono.com.co> wrote: > Hello, > > I have an APIView object with an __init__method. In that __init__ I have a > loop that extends a class list variable. Every time I make a POST to the > url tha

__init__ method called every time on same APIView object

2019-10-30 Thread Diana María Bedoya Ramírez
Hello, I have an APIView object with an __init__method. In that __init__ I have a loop that extends a class list variable. Every time I make a POST to the url that calls the APIView, the items in the loop items are added to the old ones in the list, duplicating the item number every time. Why