[sqlalchemy] Getting ORM insert/update/delete SQL

2013-05-15 Thread Jarrod Chesney
Hi I need to generate update/delete/insert SQL for a proprietary system that has an oracle database. (The system will pass the SQL onto the oracle database but for lengthy reasons, it needs to go through the proprietary system) I'm using SQLAlchemy to query the oracle database directly, i then

Re: [sqlalchemy] Getting ORM insert/update/delete SQL

2013-05-15 Thread Jarrod Chesney
Ahhh That would be better than my option A), but not as good as option B) I read that document earlier tonight too. On Wednesday, May 15, 2013 10:58:54 PM UTC+10, Mauricio de Abreu Antunes wrote: http://docs.sqlalchemy.org/en/rel_0_8/core/tutorial.html I think you can reproduce some stuff

Re: [sqlalchemy] Getting ORM insert/update/delete SQL

2013-05-15 Thread Jarrod Chesney
Is there an easy way to make it begin a transaction, execute the sql and then rollback? On 16/05/2013, at 1:10 AM, Michael Bayer mike...@zzzcomputing.com wrote: the ORM is designed to work in a highly interactive way, especially if autogenerated values are in use (like from sequences, etc.)

[sqlalchemy] AttributeError: 'GenericTypeCompiler' object has no attribute 'visit_DOUBLE_PRECISION'

2010-10-02 Thread Jarrod Chesney
Hi All I'm reflecting a postgresql schema and then taking a str() of the column types, It goes well until it hits a double field type. here is the str of my reflected column object: set: set([Column(u'ASSET_ID', DOUBLE_PRECISION(precision=53, asdecimal=False), table=tbl_SITES)]) Here is the

[sqlalchemy] Re: AttributeError: 'GenericTypeCompiler' object has no attribute 'visit_DOUBLE_PRECISION'

2010-10-02 Thread Jarrod Chesney
Thanks Michael Is this in the manual anywhere? On Oct 3, 7:44 am, Michael Bayer mike...@zzzcomputing.com wrote: On Oct 2, 2010, at 5:30 PM, Jarrod Chesney wrote: Hi All I'm reflecting a postgresql schema and then taking a str() of the column types, It goes well until it hits a double

[sqlalchemy] MapperExtension after_update

2009-10-21 Thread Jarrod Chesney
Hi I have a mapper extension that gets before_update called, but not the after_update I'm using 0.5.6 branch from SVN Here are the relevant lines of code to verify that the correct functions are overriden class SchemaObjectMapperExtension(MapperExtension): def before_update(self,

[sqlalchemy] Re: MapperExtension after_update

2009-10-21 Thread Jarrod Chesney
Problem solved. I had another mapper extension which only overrides the after_XXX functions and it wasn't returning EXT_CONTINUE Sorry. On Oct 21, 11:26 pm, Jarrod Chesney jarrod.ches...@gmail.com wrote: Hi I have a mapper extension that gets before_update called, but not the after_update

[sqlalchemy] Re: Multiple Joined Inheritance Issues

2009-10-01 Thread Jarrod Chesney
I was trying to do the same thing, But i wanted a different discriminator for the second level of inheritance. I changed mine to use the same polymorphic_on for both levels and it seemed to work for me (although not exactly how i wanted it to be) My suggestion is : Get rid of your engineer_id

[sqlalchemy] Re: Declarative base - Joined Table Inheritence

2009-09-27 Thread Jarrod Chesney
= Column(Integer, ForeignKey('tblReconcilerActions.id'), primary_key=True) revision = Column(String) comment = Column(String) On Sep 17, 10:48 am, Jarrod Chesney jarrod.ches...@gmail.com wrote: That worked, Thanks, ITS AWESOME :-) On Sep 17, 6:03 am, Conor conor.edward.da

[sqlalchemy] Re: Declarative base - Joined Table Inheritence

2009-09-16 Thread Jarrod Chesney
That worked, Thanks, ITS AWESOME :-) On Sep 17, 6:03 am, Conor conor.edward.da...@gmail.com wrote: On Sep 15, 11:03 pm, Jarrod Chesney jarrod.ches...@gmail.com wrote: Hi All I've been reading the documentation for ages and i can't figure out why when i print the results a query from my

[sqlalchemy] Declarative base - Joined Table Inheritence

2009-09-15 Thread Jarrod Chesney
Hi All I've been reading the documentation for ages and i can't figure out why when i print the results a query from my inherited table, It just prints them as the base type. I was hoping someone here would be nice enough to help me solve this problem. I thought the last print statement would

[sqlalchemy] Re: Help on Custom Type with TypeEngine (Oracle SDO_GEOM)

2009-09-08 Thread Jarrod Chesney
Sounds like you are working with Intergraph GIS, Is that correct? On Sep 8, 7:32 pm, Nicolas Dufrane dufrane.nico...@gmail.com wrote: thanks for this complete answer ! I will investigate a little more in existing projects like geoalchemy, mapfish to find a nice way to implement oracle

[sqlalchemy] Re: cloning ORM-mapped instances

2009-08-24 Thread Jarrod Chesney
I used a mapper extension. On before_update, It will copy the record and add it to an array. On after_update, It will store the new record which is an exact copy of the old record before the update. Please note, I implemented a base class for my storage units this is the sqlaorm thing. It will

[sqlalchemy] Re: SQLAlchemy as a FIFO buffer?

2009-05-20 Thread Jarrod Chesney
Sounds reasonable and fairly simple to do. I think you would need two tables. One for the tasks to be done an another for tasks completed (the history you wanted) It sounds like you would need the following functionality * Insert record - Adding records to the que * Qurey record - Finding the

[sqlalchemy] Re: SQLAlchemy GUI

2009-05-13 Thread Jarrod Chesney
Anyone? I'll take that as a No. Thanks On May 11, 8:49 pm, Jarrod Chesney jarrod.ches...@gmail.com wrote: Hi All I'm planning on making a GUI database configurator based on SQLAlchemy. It will be roughly a GUI interface to the SQLAlchemy API. Allowing the user to view/edit table data

[sqlalchemy] SQLAlchemy GUI

2009-05-11 Thread Jarrod Chesney
Hi All I'm planning on making a GUI database configurator based on SQLAlchemy. It will be roughly a GUI interface to the SQLAlchemy API. Allowing the user to view/edit table data as well as database objects. Eventually i'd like it to support most of the database access and db object

[sqlalchemy] Re: Revers Dialect - SQL Interpreter

2009-04-26 Thread Jarrod Chesney
Thank you Lord Michael On Apr 26, 2:32 am, Michael Bayer mike...@zzzcomputing.com wrote: this just came out recently http://code.google.com/p/python-sqlparse/ On Apr 24, 2009, at 9:36 PM, Jarrod Chesney wrote: Hi all again. I have a program that has a UI and allows the user to do

[sqlalchemy] Re: Revers Dialect - SQL Interpreter

2009-04-24 Thread Jarrod Chesney
of any existing python code that interprets SQL? Google hasn't helped. Otherwise, I'll write one myself. Thanks On Apr 23, 10:09 am, Jarrod Chesney jarrod.ches...@gmail.com wrote: Hi All From what i understand, The Dialect objects in sqlalchemy construct SQL statements from objects constructed

[sqlalchemy] Revers Dialect - SQL Interpreter

2009-04-22 Thread Jarrod Chesney
Hi All From what i understand, The Dialect objects in sqlalchemy construct SQL statements from objects constructed in SQLA (ORM, ect) What can i use to interpret SQL and turn it back into SQLA (or other) objects? --~--~-~--~~~---~--~~ You received this message

[sqlalchemy] Metadata - Inherited Tables, Columns

2009-04-13 Thread Jarrod Chesney
Hi, Is there a way of telling if a table is inherited from another table and which tables it inherits from in the Metadata? Further to this, Is there a way of telling which column definitions come from which table? --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: Metadata - Inherited Tables, Columns - PostGreSQL

2009-04-13 Thread Jarrod Chesney
Thanks, I'll look at that but it doesn't sound very concrete. IE using a foreign key to see if somethings inherited. Question 1 From the sqlalchemy mapper configuration, PostGreSQLs version of inheritence sounds like the concrete variary, as it automatically joins the tables together with a

[sqlalchemy] Re: Metadata - Inherited Tables, Columns

2009-04-13 Thread Jarrod Chesney
I'll look into a) do the mappers pick up foreign key constraints and the polymorphic/inherited details from the metadata when their created or do you have to specify them? - As a last resort i can query the data dictionary. Question 1 From the sqlalchemy mapper configuration, PostGreSQLs version

[sqlalchemy] Re: How to use mappers in a wxPython app?

2009-03-29 Thread Jarrod Chesney
Hi I had that same problem :-) The problem is that you declare are mapping to class that already has mapper defined for it. To work around this, I declared the class i mapped inside a function so a new class is defined every time i need to create a mapper. Where as before, When the module was