I wonder why declarative_base() doesn't simply set __tablename__ to
the name of the class by default (maybe translating camelcase to
lowercase with underscores), similar to how it is done in SQLObject
and Elixir. Also, the error message if you forget to set __tablename__
is misleading, it should
The new behavior is exactly what I expect, namely that query.count()
returns the same as len(query.all()). Are there cases in which this
does not make sense or where this would not work?
-- Christoph
--~--~-~--~~~---~--~~
You received this message because you are
On 8 Nov., 22:03, Michael Bayer [EMAIL PROTECTED] wrote:
oh sorry, also count() is meant to count instances of a single kind of
object. So in fact you should be saying:
session.query(UserRss).join(Rss, item).count()
This question is actually coming from the TurboGears group. The
problem
Only for the record: I just noticed that another simple workaround is
ordering by something like start_date is not null, start_date,
end_date is null, end_date. SA could also implement nullsfirst()/
nullslast() that way if the database engine does not support nulls
first/nulls last.