views:

51

answers:

1

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 else, what form field types are possible per model field type. Not all combinations are possible, right?

Same question for widgets...

+1  A: 

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.

Mark Lavin
Well then, is there a matrix somewhere that specifies the result of each combination?Alternatively, is there a sandbox you can try things out, except for building it yourself, of course...
Jonathan
Check the docs on each form field type and it will say what the field normalizes to: http://docs.djangoproject.com/en/1.2/ref/forms/fields/#built-in-field-classes If your corresponding model field can accept that type of data then it will work. Not sure why you seem opposed to simply trying a combination you're not sure about.
Mark Lavin