批量插入数据 bulk_create # 1.往书籍表中插入数据 1000 # for i in range(1000): # 这种插入方式 效率极低 # models.Book.objects.create(title='第%s本书'%i) book_list = [] for i in range(100000): # 时间还是很短 两者差距很大 book_list.append(models.Book(title='第%s本书'%i)) models.Book.objects.bulk_c
批量插入数据 后端: def fenye(request): book_list=[] for i in range(100): book_list.append(models.Book(title='第%s本书'%i)) models.Book.objects.bulk_create(book_list) book_qurery=models.Book.objects.all() return render(request,'fenye.html',locals()) 前端: {% for b
It can be incredibly frustrating to spend a few minutes filling out a form only to accidentally lose all of your progress by the browser closer, the page refreshing, or many other terrible scenarios. formik-persist saves you from that fate by providi
In this lesson we'll talk about controlling the value for inputs, textareas, and select elements. We'll see how to manage the state ourselves while still allowing the user to update the values themselves.