Hi there,
I have a problem to understand how aliased classes are used in
orm.query.
I have an polymorphic single-inheritance table, which is a lookup
table for about 10 other tables.
On some of that tables there are more than one column which relates to
that table, so they have to be aliased.
On Jul 4, 2011, at 2:29 AM, Michael Tils wrote:
rating = aliased(BuildingRating)
care_level = aliased(BuildingCareLevel)
to make later:
.query(Building).filter( or_( rating.value.like(%good),
care_level.value.like(well_groomed) ) )
But I couldn't work out how to explicit name
Hello,
thanks for your help.
The joins Building.condition and Building.care_level are pointing the same
table. The table is a single-inheritance construct.
The query:
session.query(Building).join(rating, Building.condition).join(care_level,
Building.care_level)
produces this error:
Here is my mapping, this time in german...
Building class:
class Lookup(OrmBaseObject):
id = 0
lookupCategoryId = 0
category = LookupCategory
value = ''
properties = {
'lookupCategoryId':tables['lookup'].c.lookup_category_id,
'category':
On Jul 4, 2011, at 3:25 PM, Michael Tils wrote:
Here is my mapping, this time in german...
OK, sifting through lots of extraneous details as well as the lack of the
actual table definitions, it seems like you're looking to join from
Building-BuildingCondition-Lookup.
I don't use