Opened 13 years ago

Closed 12 years ago

#11192 closed (fixed)

ModelForms development error messages

Reported by: Anton Kolechkin Owned by: Anton Kolechkin
Component: Forms Version: dev
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: 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.

Attachments (1)

ModelForms_checks.patch (785 bytes) - added by Anton Kolechkin 13 years ago.

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by Anton Kolechkin

Attachment: ModelForms_checks.patch added

comment:1 Changed 13 years ago by Anton Kolechkin

There is patch for form/

comment:2 Changed 13 years ago by Karen Tracey

milestone: 1.1

Please don't put things in the 1.1 milestone unless they are critical bugs. A perhaps non-ideal error message does not fit into that category.

comment:3 Changed 13 years ago by Anton Kolechkin

Has patch: set

Sorry, didn't known milestone stuff. (it is my first ticket and patch)

comment:4 Changed 13 years ago by Alex Gaynor

Triage Stage: UnreviewedDesign decision needed

comment:5 Changed 12 years ago by anonymous

The problem has been fixed in 1.2 release. Thanks.

comment:6 Changed 12 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

I can't reproduce this with 1.1 or 1.2.

Note: See TracTickets for help on using tickets.
Back to Top