Opened 9 years ago

Closed 9 years ago

#2952 closed enhancement (wontfix)

Please show location of errors (& be consistant with max_...)

Reported by: Yary Owned by: russellm
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: freakboy3742@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I'm working on a medium-sized data model, and am fixing initial typos like missing quotes or caps. The errors give me are surprisingly vague, since they don't tell me either line number or object: validate

Site.Q: name 'name' is not defined
1 error found.

(The identifier 'name' is all over the model, where did I use it wrong?) validate

Site.Q: name 'question' is not defined
1 error found.

(same as above... I'd like to know which object model is using
'question' wrong, or a line number...) validate

Site.Q: init() got an unexpected keyword argument 'max_length'
1 error found.

(OK I can find max_length, but it irks me that django uses 'max_digits'
with the underscore, but drops the underscore from 'maxlength!)

Change History (2)

comment:1 Changed 9 years ago by russellm

  • Cc freakboy3742@… added
  • Owner changed from adrian to russellm

Can you provide an example model that demonstrates the 'name' not defined errors?

The maxlength/max_digits discrepancy is a separate problem; please file as a unique ticket.

comment:2 Changed 9 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

name 'name' is not defined is not a Django-specific error; it's a Python syntax error. You're trying to use a variable that you haven't defined yet.

For the record, that Python error is collected in django.db.models.loading.get_apps() and used in There doesn't seem to be a way to get the line number of an exception like that without bringing in some other machinery (such as the traceback module), which I see as too heavyweight for use here. Hence, I'm marking this as a wontfix.

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