necessary, btw) will have the label anonymized when
the instance is part of the eager join, to prevent
conflicts with a subquery or column of the same name
- on the parent object. [ticket:1019]
+ on the parent object. [ticket:1019]
+
+ - same as [ticket:1019] but repaired the non-labeled use case
+ [ticket:1022]
- Adjusted class-member inspection durint attribute and
collection instrumentation that could be problematic when
rec = props[key]
except KeyError:
# fallback for targeting a ColumnElement to a textual expression
- # it would be nice to get rid of this but we make use of it in the case where
- # you say something like query.options(contains_alias('fooalias')) - the matching
- # is done on strings
+ # this is a rare use case which only occurs when matching text()
+ # constructs to ColumnElements
if isinstance(key, expression.ColumnElement):
if key._label and key._label.lower() in props:
return props[key._label.lower()]
- elif key.name.lower() in props:
+ elif hasattr(key, 'name') and key.name.lower() in props:
return props[key.name.lower()]
raise exceptions.NoSuchColumnError("Could not locate column in row for column '%s'" % (str(key)))
key = property(key)
def _label(self):
- return self.elem._label
+ try:
+ return self.elem._label
+ except AttributeError:
+ return self.anon_label
_label = property(_label)
def _copy_internals(self, clone=_clone):
for user in session.query(User).all():
self.assertEquals(user.query_score, user.prop_score)
+ u = session.query(User).filter_by(name='joe').one()
+ self.assertEquals(u.query_score, u.prop_score)
+
+ for t in (tags_table, users_table):
+ t.delete().execute()
+
if __name__ == '__main__':
testenv.main()