#12285: Confusing error message when ModelForm does not have model set
---------------------------+------------------------------------------------
 Reporter:  RaceCondition  |       Owner:  nobody    
   Status:  new            |   Milestone:  1.2       
Component:  Forms          |     Version:  1.1       
 Keywords:                 |       Stage:  Unreviewed
Has_patch:  0              |  
---------------------------+------------------------------------------------
 When instantiating a {{{ModelForm}}} whose {{{Meta.model}}} has not been
 set (i.e. the {{{ModelForm}}} class was extended instead of {{{Form}}}),
 the exception message is:

 {{{'NoneType' object is not callable}}}

 This message originates from {{{django/forms/models.py in __init__ line
 218}}} that says {{{self.instance = opts.model()}}}.

 Adding an {{{if}}} there with a decent message such as {{{"Model class not
 set for ModelForm"}}} would be the fix.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/12285>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to