Field 'roof_age' expected a number but got ('1',)

2022-09-17 Thread Nishant Sagar
Hey folks, While saving the values to the data to the database I'm getting this Field 'roof_age' expected a number but got ('1',) How can I resolve this? Here is my views.py file def form(requests): if requests.method == 'POST': name=requests.POST['name'], # roof_age= requests.POST['roof_age'], r

Re: Field 'roof_age' expected a number but got ('1',)

2022-09-17 Thread Esteban Chacon Martin
Also take off each comma after the assigment and that should fix it all, forget about indexing as i recommend before El sáb, 17 sept 2022 a las 14:38, Esteban Chacon Martin () escribió: > Use requests.POST.get('roof_age')[0] instead, seems to me like you are > getting a list instead of a string w

Re: Field 'roof_age' expected a number but got ('1',)

2022-09-17 Thread Esteban Chacon Martin
Use requests.POST.get('roof_age')[0] instead, seems to me like you are getting a list instead of a string when doing the get -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group an

Re: Field 'roof_age' expected a number but got ('1',)

2022-09-17 Thread Nishant Sagar
I really appreciate your help, removing comma has fixed the problem but now for check boxes and bill (which is file type) I’m getting string output instead of bool and file How can I fix that now? On Sun, 18 Sep 2022 at 1:24 AM, Esteban Chacon Martin wrote: > Also take off each comma after the