Re: [sqlalchemy] automap : problem with two relationships on same foreign key

2016-01-02 Thread Mike Bayer
On 01/02/2016 11:38 AM, yoch.me...@gmail.com wrote: > Thank you. > > I hesitate between using this way, or explicitly specify the relationship > (is this a good idea? In my test I found 3 relations after prepare()) : it's fine to do that. Automap is still building its own relationship as well

[sqlalchemy] how to pick up constraint violation errors in Alchemy

2016-01-02 Thread Krishnakant
hello all, I wish to know how I can pick up the constraint failure errors in my code? I think I would probably have to pick up the errors in a try: except: system? But What is the exact way of picking up the message? Do we have a ready made exception for each constraint? such as Unique or

Autogenerate ALWAYS assumes an empty schema with Oracle 11.2

2016-01-02 Thread Nana Okyere
Disclosure: I'm a newbie :-) Starting with an empty table, I autogenerate and then do upgrade and it works fine the first time. When I make a small change to the model(s) like adding a new column, then I do autogenerate, alembic generates the upgrade and downgrade code as if starting from

Re: [sqlalchemy] automap : problem with two relationships on same foreign key

2016-01-02 Thread yoch . melka
Thank you. I hesitate between using this way, or explicitly specify the relationship (is this a good idea? In my test I found 3 relations after prepare()) : class Thermostat(Base): __tablename__ = 'thermostats' idbuiltin = Column(Integer, ForeignKey('device.id')) idthermometer =

Autogenerate ALWAYS assumes an empty schema with Oracle 11.2

2016-01-02 Thread Nana Okyere
Disclosure: I'm a newbie :-) Starting with an empty table, I autogenerate and then do upgrade and it works fine the first time. When I make a small change to the model(s) like adding a new column, then I do autogenerate, alembic generates the upgrade and downgrade code as if starting from

Re: Autogenerate ALWAYS assumes an empty schema with Oracle 11.2

2016-01-02 Thread Mike Bayer
On 01/02/2016 01:18 PM, Nana Okyere wrote: > Disclosure: I'm a newbie :-) > > Starting with an empty table, I autogenerate and then do upgrade and it > works fine the first time. When I make a small change to the model(s) > like adding a new column, then I do autogenerate, alembic generates

Re: [sqlalchemy] how to pick up constraint violation errors in Alchemy

2016-01-02 Thread Mike Bayer
On 01/02/2016 01:02 PM, Krishnakant wrote: > hello all, > I wish to know how I can pick up the constraint failure errors in my code? > I think I would probably have to pick up the errors in a try: except: > system? that is correct. > But What is the exact way of picking up the message? You'd

Re: Autogenerate ALWAYS assumes an empty schema with Oracle 11.2

2016-01-02 Thread Nana Okyere
The tables are not in an explicitly named schema. By default, it uses the schema of the user logged in. Looking at the debug output on the console, I can see that it uses the correct schema i.e. SYSTEM. I set the logging to debug and went through the whole process. I'll attach the entire

Re: [sqlalchemy] how to pick up constraint violation errors in Alchemy

2016-01-02 Thread Krishnakant
On Sunday 03 January 2016 04:20 AM, Mike Bayer wrote: On 01/02/2016 01:02 PM, Krishnakant wrote: hello all, I wish to know how I can pick up the constraint failure errors in my code? I think I would probably have to pick up the errors in a try: except: system? that is correct. But What is