开发者

How i can get the class of a model in a widget through ModelForms in Admin?

i need make a special widget for ForeignKeys in Admin, but i need get the class of model in the widget, somebody know how i can do it?开发者_C百科

I think the Widget have a Field, and Field have a ModelForm, and obviously ModelForm have a Model, but i need this model in a widget in the admin.


Perhaps looking at the ModelChoiceField form widget would help? http://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L921

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜