-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
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
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
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
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.
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
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
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