Django

Code

Ticket #10414 (new)

Opened 1 year ago

Last modified 3 weeks ago

select_related ignores unrecognized fields

Reported by: trebor74hr Assigned to: nobody
Milestone: 1.3 Component: Database layer (models, ORM)
Version: Keywords: select_related
Cc: Triage Stage: Design decision needed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

This doesn't report any problems:

>>> models.ReportField.objects.select_related("i can type here", "whatever i want", 
                                              "and won't get error or warning at least", "it is ignored!")[0]
<ReportField: 61.Report Field XXX>

I think that select_related in "fields mode" should check if values are ok (<model.fk_fieldname>, <model.fk_fieldname><depmodel1.fk_fieldname>, etc.).

Attachments

Change History

03/05/09 03:45:35 changed by mtredinnick

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

I'm pretty sure there's a good reason it's doing this (at least on the implementation level). Have to try and remember what it is. Otherwise we should add some error reporting, providing it doens't slow things down too much.

03/05/09 10:45:10 changed by jacob

  • stage changed from Unreviewed to Design decision needed.

01/11/10 09:32:18 changed by CollinAnderson

I've ran into this issue before. Typos and other errors are getting silently ignored. Not very django-like.

01/12/10 04:37:49 changed by russellm

  • milestone set to 1.2.

This is either going to be trivial or impossible to fix. Either way, we should address this for 1.2

03/03/10 16:54:30 changed by ubernostrum

  • milestone changed from 1.2 to 1.3.

While I agree it'd be nice to have error reporting when you mistype a field name there, I don't see it as critical for 1.2 to get out the door.


Add/Change #10414 (select_related ignores unrecognized fields)




Change Properties
Action