I have two lists:
a = ['a', 'b', 'c']
b = [1]
I want my output as:
a, 1
b, 1
c, 1
Tried doing this:
for i, j in zip(a, b):
print i, j
I get only a, 1. How can I make it right?
This is my actual scenario:
if request.POST.get('share'):
choices = request.POST.getlist('choice')
person = request.POST.getlist('select')
person = ''.join(person)
person1 = User.objects.filter(username=person)
for i, j in izip_longest(choices, person1, fillvalue=person1[-1]):
start_date = datetime.datetime.utcnow().replace(tzinfo=utc)
a = Share(users_id=log_id, files_id=i, shared_user_id=j.id, shared_date=start_date)
a.save()
return HttpResponseRedirect('/uploaded_files/')
User.objects.filter(username=person)returns, may be it returns an iterator?