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
精彩评论