Passing invalid column names to selectBy doesn't break
Bug #681870 reported by
Julian Edwards
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
For the SQLObject compatibility layer - if I pass a bogus column name as one of the args to selectBy it just returns an empty result set. I'd really expect it to throw an exception so we can catch typos.
To post a comment you must log in.
The keyword arguments to selectBy() are converted to the where clause with:
for key, value in self._by.items():
args. append( getattr( self._cls, key) == value)
So you should get an AttributeError if you make a typo, unless the incorrect attribute name actually exists on the class. Perhaps that is what you observed?