开发者

Get primary key for a ModelChoiceField based on his "id" in the form

I am using a Django form wich contains a ModelChoiceField.

In my form I want to update a part of the form with Ajax when the user change the value in the <select>

I pass to my ajax view开发者_如何转开发 the id of the option selected, but I would like to know how can I retrieve from this id the pk associated in my DB.

Thank you in advance for your help!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜