Django's documentation specifies for each model field type the corresponding default form field type. Alas, I couldn't find in the documentation, or anywhere el开发者_StackOverflow中文版se, what form field types are possible per model field type. Not all combinations are possible, right?
Same question for widgets...
There's a difference between what is possible in the sense of Django will allow you to do it and possible in that it will actually work. Django does not restrict which field types you can use so all combinations are possible in that sense. Some likely wouldn't make sense and others wouldn't work at all like using an forms.ImageField
for a models.IPAddressField
. It is up to the developer to know the difference.
精彩评论