[sqlalchemy] Explicitly name the not null constraint for an Oracle primary key

2015-12-04 Thread Thijs Engels
Dear all, For maintenance purposes I have aiming to ensure that ALL database constraint have an explicit name (as recommended here as well: http://alembic.readthedocs.org/en/latest/naming.html) With the NOT NULL constraints this can be done by adding an explicit CheckConstraint. However at least

Re: [sqlalchemy] ORM Join with Group By

2013-04-07 Thread Thijs Engels
Thank you very much for your effort in putting together a complete and working example. Much appreciated, Thijs On Sat, Apr 6, 2013, at 18:10, Audrius Kažukauskas wrote: > Hi, Thijs, > > On Thu, 2013-04-04 at 21:36:56 +0200, Thijs Engels wrote: > > Assume a database with two t

[sqlalchemy] ORM Join with Group By

2013-04-04 Thread Thijs Engels
I was wondering whether someone would be able to help me out with a SQLAlchemy query (not sure whether this is the correct term) Assume a database with two tables; sessions and events. Sessions has a primary key id and some additional information. Events has a primary key which consists of session

Re: [sqlalchemy] Potential issue with SQLAlchemy/cx_Oracle (under Python 3)

2013-02-08 Thread Thijs Engels
On Fri, Feb 8, 2013, at 18:43, Michael Bayer wrote: > > On Feb 8, 2013, at 12:31 PM, Michael Bayer wrote: > > > > On Feb 8, 2013, at 10:29 AM, Thijs Engels wrote: > > > > > > Works fine with both Python 2.7 and 3.3. Running the (even more) direct > > &g

Re: [sqlalchemy] Potential issue with SQLAlchemy/cx_Oracle (under Python 3)

2013-02-08 Thread Thijs Engels
On Fri, Feb 8, 2013, at 15:49, Michael Bayer wrote: > > On Feb 8, 2013, at 5:47 AM, Thijs Engels wrote: > > > > > Running this script on 3.3 results in this error message: > > > > sqlalchemy.exc.IntegrityError: (IntegrityError) ORA-01400: cannot insert &

Re: [sqlalchemy] Potential issue with SQLAlchemy/cx_Oracle (under Python 3)

2013-02-08 Thread Thijs Engels
On Fri, Feb 8, 2013, at 11:47, Thijs Engels wrote: > > Is it correct to assume this would be related to SQLAlchemy? > I forgot to mention that a raw insert using cx_Oracle directly is fine for both Python 2.7 and 3.3. - import cx_Oracle connection = cx_Oracle.Connection(&qu

[sqlalchemy] Potential issue with SQLAlchemy/cx_Oracle (under Python 3)

2013-02-08 Thread Thijs Engels
Hello, I am currently investigating whether all my current Python work/scripts will work with Python 3 (v3.3.0). And I am running into an issue which seems to be related to this. I have made an example (or actually took the one from the documentation) to illustrate the issue. Currently running Py

[sqlalchemy] Relationship definition problem

2012-02-01 Thread Thijs Engels
I am currently facing a problem with a legacy database for which I am creating a SQLAlchemy layer. With regards to mirroring the columns everything goes well. However I am having difficulties defining a relationship which is not many-to-many, but does use something which can be compared with an ass

[sqlalchemy] Relationship with a parameter?

2012-01-05 Thread Thijs Engels
When going through the (excellent) documentation on relationsship I came across this example: from sqlalchemy import Integer, ForeignKey, String, Column from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship Base = declarative_base() class User(Base):

[sqlalchemy] Issue with compound foreign key

2011-11-04 Thread Thijs Engels
I am having some trouble getting the code below to work... running the code below will give this error message when trying to create a Session object (last line): sqlalchemy.exc.ArgumentError: Could not determine relationship direction for primaryjoin condition 'ChildArea.session_id==ParentArea.se