开发者

How can i retrieve the row just entered in database in django

开发者 https://www.devze.com 2023-03-17 01:19 出处:网络
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 tha

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号