Opened 15 years ago

Closed 14 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

Description

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 15 years ago.

Download all attachments as: .zip

Change History (7)

by Anton Kolechkin, 15 years ago

Attachment: ModelForms_checks.patch added

comment:1 by Anton Kolechkin, 15 years ago

There is patch for form/models.py

comment:2 by Karen Tracey, 15 years ago

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 by Anton Kolechkin, 15 years ago

Has patch: set

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

comment:4 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedDesign decision needed

comment:5 by anonymous, 14 years ago

The problem has been fixed in 1.2 release. Thanks.

comment:6 by Russell Keith-Magee, 14 years ago

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