ModelForms development error messages
|Reported by:||Anton Kolechkin||Owned by:||Anton Kolechkin|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
from django.forms import ModelForm class TrustForm(ModelForm): class Meta: pass # forgotten model attribute here
If Meta in formclass has no model attribute it raises exception like this:
TypeError at /exampleurl/ 'NoneType' object is not callable.
I guess my patch makes more informative exception messages. ValueError and TypeError may be wrong here, may be use AssertError instead, don't know.