can insert loop data into django model?..
here my code. on view.py
class EmpCreateView(CreateView):
fields = ()
model = models.Employee
def form_valid(self, form):
self.object = form.save(commit=False)
loopdo = 5
while loopdo > 0:
self.object.name = "work?"
self.object.no = loopdo
self.object.save()
loopdo -= 1
return super(ModelFormMixin, self).form_valid(form)
it's only insert 1 data.