How can i retrieve the row just entered in database in django
I used this function to save data in Mysql
form.save()
Now i want to send the row back so that i can dynamically update the Table and append the row at Botto开发者_如何学Gom. How can i retrieve that
If you save data to MySQL using form.save()
so you probably use ModelForm
.
So ModelForm save method returns the instance of Model (row):
row = form.save()
More on this: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-save-method
精彩评论