[sqlalchemy] Suggestions for abbreviations

2009-01-11 Thread Cito
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

[sqlalchemy] Re: problem with join, count on 0.5.0rc3

2008-11-10 Thread Cito
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

[sqlalchemy] Re: problem with join, count on 0.5.0rc3

2008-11-09 Thread Cito
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

[sqlalchemy] Re: Ordering null dates

2008-06-10 Thread Cito
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.