- changed status to resolved
OrderedProperties suffers from clashes between table columns names and its own methods
OrderedProperties provides the getattr method which allows to lookup for column information using the dot notation, the issue is that in case my column was actually called like a method of OrderedProperties it returns the method instead of the column.
This is probably not a bug, but it's an unexpected behaviour in most cases. See https://github.com/TurboGears/tg2/issues/64 for origin of this issue.
Probably dot notation access should be deprecated to avoid confusion and only allow dictionary stile access?
Comments (3)
-
repo owner -
repo owner - add a warning suggesting to use the dictionary form of access
if the name of the attribute being accessed is non-specific,
thereby avoiding collisions on names like items, values, keys.
fixes
#3475
(cherry picked from commit 6fcc5d4a07e5c409a7d8438582598d0e90562ea0)
→ <<cset a0ba7ce055d3>>
- add a warning suggesting to use the dictionary form of access
if the name of the attribute being accessed is non-specific,
thereby avoiding collisions on names like items, values, keys.
fixes
-
repo owner this is the object that does
table.c.columname
so deprecation would be pretty extreme. getattr() shouldn't be used with this object so a warning is added thanks for reporting! - Log in to comment
#3475→ <<cset 6fcc5d4a07e5>>