[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11.01.2009 12:13 Uhr, Cito wrote: 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). Please no implicit magic under the hood. You

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Christoph Zwerschke
Andreas Jung schrieb: Please no implicit magic under the hood. You can have multiple mappers for the same table. Citing Guido: explicit is better than implicit. You wouldn't be forced to use that magic, you could still set __tablename__ explictly. I understand your argument, but otoh

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 6:13 AM, Cito wrote: 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

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Christoph Zwerschke
Michael Bayer schrieb: As far as implicit tablename, it breaks the single inheritance scenario. but also besides that I made a comment on that here: http://www.sqlalchemy.org/trac/ticket/1270#comment:2 Thanks, I hadn't seen that. Not quite sure what you mean with single inheritance

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 11:06 AM, Christoph Zwerschke wrote: Michael Bayer schrieb: As far as implicit tablename, it breaks the single inheritance scenario. but also besides that I made a comment on that here: http://www.sqlalchemy.org/trac/ticket/1270#comment:2 Thanks, I hadn't seen that.

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Christoph Zwerschke
Michael Bayer schrieb: if Bar inherits from Foo, Foo is mapped to foo_table, Bar has no table, Bar will be mapped to foo_table as well. In that case, no implicit name should be set or course. It should only be set if a name cannot be figured out otherwise. oh, this is entirely news to me

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Michael Bayer
On Jan 11, 2009, at 11:41 AM, Christoph Zwerschke wrote: Michael Bayer schrieb: if Bar inherits from Foo, Foo is mapped to foo_table, Bar has no table, Bar will be mapped to foo_table as well. In that case, no implicit name should be set or course. It should only be set if a name cannot

[sqlalchemy] Re: Suggestions for abbreviations

2009-01-11 Thread Christoph Zwerschke
Michael Bayer schrieb: ArgumentError: Mapper 'Mapper|User|None' does not have a mapped_table specified. (Are you using the return value of table.create()? It no longer has a return value.) That's a really old error message, and I can see how its less than perfect so I've just