Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-20 Thread Ignas Mikalajunas
Tried, everything works. Awesome! Ignas On Sun, May 20, 2012 at 2:34 AM, Michael Bayer wrote: > thanks.  try r896d404af747. > > > On May 19, 2012, at 12:09 PM, Ignas Mikalajunas wrote: > >> CREATE TABLE users ( >>    id bigserial NOT NULL, >>    primary key (id) >> ); >> >> CREATE TABLE wall_pos

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-19 Thread Michael Bayer
thanks. try r896d404af747. On May 19, 2012, at 12:09 PM, Ignas Mikalajunas wrote: > CREATE TABLE users ( >id bigserial NOT NULL, >primary key (id) > ); > > CREATE TABLE wall_posts ( >id bigserial not null, >user_id integer, >foreign key (user_id) references users on delete

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-19 Thread Ignas Mikalajunas
CREATE TABLE users ( id bigserial NOT NULL, primary key (id) ); CREATE TABLE wall_posts ( id bigserial not null, user_id integer, foreign key (user_id) references users on delete cascade, primary key (id) );; CREATE TABLE wall_post_stars ( wall_post_id integer NOT NULL

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-19 Thread Michael Bayer
What's the fk setup there, do you have an FK column that is also a PK? Sent from my iPhone On May 19, 2012, at 7:24 AM, Ignas Mikalajunas wrote: > Hi, > >>> A stack trace here would be extremely helpful. > > sorry forgot the error message for the traceback: > > NoReferencedColumnError: Coul

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-19 Thread Ignas Mikalajunas
Hi, >> A stack trace here would be extremely helpful. sorry forgot the error message for the traceback: NoReferencedColumnError: Could not create ForeignKey 'wall_posts.id' on table 'wall_post_stars': table 'wall_posts' has no column named 'id' Ignas -- You received this message because you a

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-19 Thread Ignas Mikalajunas
Hi, thanks for all your work :) >> I can't set neither polymorphic_on > > set this using a string - polymorphic_on = 'type'. Oh, Indeed that works. >> nor sort_on columns in mapper > > order_by?   OK, I'm not a huge fan of mapper order_by but we can come up with > something on that Thanks

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-18 Thread Michael Bayer
On May 18, 2012, at 9:41 AM, Michael Bayer wrote: > > >> nor sort_on columns in mapper > > order_by? OK, I'm not a huge fan of mapper order_by but we can come up with > something on that the latest tip ensures that __mapper_args__ is not invoked until after the table is reflected and

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-18 Thread Michael Bayer
On May 17, 2012, at 6:58 PM, Ignas Mikalajunas wrote: > Small issues so far: > > I can't set neither polymorphic_on set this using a string - polymorphic_on = 'type'. > nor sort_on columns in mapper order_by? OK, I'm not a huge fan of mapper order_by but we can come up with something on t

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-17 Thread Ignas Mikalajunas
On Thu, May 17, 2012 at 6:54 PM, Michael Bayer wrote: > > On May 14, 2012, at 6:32 AM, Ignas Mikalajunas wrote: > >> On Sun, May 13, 2012 at 1:05 PM, Michael Bayer >> wrote: >>> Michael Bayer wrote: On May 11, 2012, at 1:16 PM, Ignas Mikalajunas wrote: > Even though the latest

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-17 Thread Michael Bayer
On May 14, 2012, at 6:32 AM, Ignas Mikalajunas wrote: > On Sun, May 13, 2012 at 1:05 PM, Michael Bayer > wrote: >> Michael Bayer wrote: >>> >>> On May 11, 2012, at 1:16 PM, Ignas Mikalajunas wrote: >>> Even though the latest version of the DeclarativeRefletive example includes some

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-14 Thread Ignas Mikalajunas
On Sun, May 13, 2012 at 1:05 PM, Michael Bayer wrote: > Michael Bayer wrote: >> >> On May 11, 2012, at 1:16 PM, Ignas Mikalajunas wrote: >> >>> Even though the latest version of the DeclarativeRefletive example >>> includes some handling for inheritance, I still can not get it to >>> work. I try d

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-13 Thread Michael Bayer
Michael Bayer wrote: > > On May 11, 2012, at 1:16 PM, Ignas Mikalajunas wrote: > >> Even though the latest version of the DeclarativeRefletive example >> includes some handling for inheritance, I still can not get it to >> work. I try doing (mostly modified example from >> https://bitbucket.org/sql

Re: [sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-11 Thread Michael Bayer
On May 11, 2012, at 1:16 PM, Ignas Mikalajunas wrote: > Even though the latest version of the DeclarativeRefletive example > includes some handling for inheritance, I still can not get it to > work. I try doing (mostly modified example from > https://bitbucket.org/sqlalchemy/sqlalchemy/src/408388

[sqlalchemy] How should I do inheritance using DeclarativeReflectedBase?

2012-05-11 Thread Ignas Mikalajunas
Even though the latest version of the DeclarativeRefletive example includes some handling for inheritance, I still can not get it to work. I try doing (mostly modified example from https://bitbucket.org/sqlalchemy/sqlalchemy/src/408388e5faf4/examples/declarative_reflection/declarative_reflection.py