This code creates a formset and populates fields with copies of date and start_time. The problem is, if num_events is X then it creates X forms but it only populates X-1 (it leaves the last one uninitialized). My question is why, and how to fix it? Thanks.
DateTimeFormSet = formset_factory(DateTimeForm) initial_data_list = [] pattern_datetime_dict = { 'date':event.date, 'start_time':event.time_start, } for x in range(1, num_events): initial_data_list.append(pattern_datetime_dict) formset = DateTimeFormSet(initial = initial_data_list) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---