On Apr 10, 2008, at 3:31 AM, Dieter Verfaillie wrote:
> Hello, > > I've created a single table inheritance hierarchy where SpecialThing > inherits from BasicThing. > > When I session.query(BasicThing).count() the correct count is > returned, > but session.query(SpecialThing).count() returns the count for > BasicThing. In other words, when issuing .count() the 'WHERE > discriminatorfield='something' clause disappears from the query. thats probably a bug. the main "compile_context" routine contains an extra bit of logic to do the "where discriminator" clause and this logic is not currently present in count(). As a workaround, you can add the filter() criterion manually. It would be of great help if you could attach this test case to a trac ticket (just login as guest/ guest). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---