Re: [sqlalchemy] postgres schema per model

2013-12-06 Thread Richard Gerd Kuesters
well ... i think i was right when i said that this implementation doesn't work, and i don't know exactly why. using abstract, declared_attr or __table_args__ via inheritance is not creating my models in another schema. if i put it explicitly in the model, it works fine. inherited? nopes. no

[sqlalchemy] postgres schema per model

2013-12-05 Thread Richard Gerd Kuesters
hi all! another question: i have a postgres database, and i would like to work with schemas for module models. so far so good, but i didn't find much information besides it is available in sa docs. so, i came into this:

Re: [sqlalchemy] postgres schema per model

2013-12-05 Thread Michael Bayer
here’s an example, works on this end: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class AltSchema(object): __table_args__ = {schema: test_schema} class A(AltSchema, Base): __tablename__ = 'a'

Re: [sqlalchemy] postgres schema per model

2013-12-05 Thread Richard Gerd Kuesters
ha! thanks Mike! i must have been stupid somewhere. i could say that i did that but, since it didn't worked then, i can say that my code was wrong somehow :) my best regards, richard. On 12/05/2013 01:37 PM, Michael Bayer wrote: here’s an example, works on this end: from sqlalchemy