开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜