Re: Make a loop to get request.POST information

2018-11-26 Thread kennedy kay
Or you can simply do something like this ##method 1 > > Polls = [] > > for x in range(1, 4): > > #then creat a list of poll objects and append to the polls list > > Polls.append('input_'+str(x)) > > polls = Polls.object.create(motsclef = request.POST['input_{x}' for x in range(3)]) On M

Re: Make a loop to get request.POST information

2018-11-26 Thread kennedy kay
This should work ##method 1 > Polls = [] > for x in range(1, 4): > #then create a list of poll objects and append to the polls list > Polls.append('input_'+str(x)) On Monday, November 26, 2018 at 5:13:01 PM UTC+1, Thibaud MONTAGNON wrote: > > Hi, > > I got 3 differents input named input_1, i

Re: Make a loop to get request.POST information

2018-11-26 Thread Thibaud MONTAGNON
It's work ! Thanks :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-user

Re: Make a loop to get request.POST information

2018-11-26 Thread shiva kumar
Try this Replace 'input_'.a with 'input_'+str(a) I think it will work On Mon 26 Nov, 2018 9:43 pm Thibaud MONTAGNON Hi, > > I got 3 differents input named input_1, input_2, input_3 and I want to > make a loop to put them in the ddb. > > I try to use this code but it dosent work... > > row=[

Make a loop to get request.POST information

2018-11-26 Thread Thibaud MONTAGNON
Hi, I got 3 differents input named input_1, input_2, input_3 and I want to make a loop to put them in the ddb. I try to use this code but it dosent work... row=[1,2,3] for a in row: polls = Polls.objects.create(motsclef=request.POST[*'input_'.a*]) Could you help me ? (I ju