Re: [sqlalchemy] Error message: ArgumentError: Could not determine dialect for 'mssql+pyodbc'.

2013-04-09 Thread Michael Bayer
and this used to work? if you're using 0.7, it uses a fairly primitive system based on __import__(). you'd want to make sure py2exe is putting every .py file under dialects/ into the final package. On Apr 9, 2013, at 3:35 PM, Don Dwiggins wrote: > I have an application using SA that I distr

[sqlalchemy] site downtime

2013-04-09 Thread Michael Bayer
hey lists - Linode is giving everyone twice the RAM for free, so we're currently undergoing a short migration period on our host. If it goes well, we should be up in five minutes, if not, then hopefully within 20 minutes. - mike -- You received this message because you are subscribed to the

[sqlalchemy] Error message: ArgumentError: Could not determine dialect for 'mssql+pyodbc'.

2013-04-09 Thread Don Dwiggins
I have an applicationusing SA that I distributein "compiled" form, using py2exe. This has been working well, but I recently ran into a problem. I do a create_engine with the string "mssql+pyodbc://%(UserName)s:%(Password)s@%(DSN)s" (the parameters are filled in using a "%" operator). This wo

Re: [sqlalchemy] automating inheritance

2013-04-09 Thread Gerald Thibault
Awesome, thanks a ton for the update and fix. On Tuesday, April 9, 2013 11:25:44 AM UTC-7, Michael Bayer wrote: > > thanks, now I know what you mean by "the class will now have a table > attached to it". This behavior is a side effect of the issue raised in > http://www.sqlalchemy.org/trac/tick

Re: [sqlalchemy] automating inheritance

2013-04-09 Thread Michael Bayer
thanks, now I know what you mean by "the class will now have a table attached to it". This behavior is a side effect of the issue raised in http://www.sqlalchemy.org/trac/ticket/2656 (which also applies to 0.7), but since __mapper_args__() is evaluated later, this turns it into more or less of

[sqlalchemy] Re: automating inheritance

2013-04-09 Thread Gerald Thibault
Here is a test. It's possible the failure is because the provided example uses a mixin, while i am declaring directly on the base class. from sqlalchemy import * from sqlalchemy.ext.declarative import (declarative_base, declared_attr, has_inherited_table) Base = declarative_base() class Tes

Re: [sqlalchemy] Unexpected SQL output for query with contains_eager and innerjoin

2013-04-09 Thread Etienne Rouxel
All right, thank you very much. Le mardi 9 avril 2013 17:27:38 UTC+2, Michael Bayer a écrit : > > > On Apr 9, 2013, at 11:21 AM, Etienne Rouxel > > > wrote: > > Hello Michael, thank you for your answer. > > It is written in the documentation ( > http://docs.sqlalchemy.org/en/rel_0_8/orm/relation

Re: [sqlalchemy] Unexpected SQL output for query with contains_eager and innerjoin

2013-04-09 Thread Michael Bayer
On Apr 9, 2013, at 11:21 AM, Etienne Rouxel wrote: > Hello Michael, thank you for your answer. > > It is written in the documentation > (http://docs.sqlalchemy.org/en/rel_0_8/orm/relationships.html#sqlalchemy.orm.relationship) > : > innerjoin=False – > when True, joined eager loads will use a

Re: [sqlalchemy] Relationship setup problem

2013-04-09 Thread Michael Bayer
On Apr 9, 2013, at 10:27 AM, Werner wrote: > Hi Michael, > > Didn't see this one before my last post. > > On 09/04/2013 16:19, Michael Bayer wrote: >> 1. is Winracku.combrack intended to be many-to-one or one-to-many ? > One to many, in other words just to make sure that I don't mess up > ter

Re: [sqlalchemy] Unexpected SQL output for query with contains_eager and innerjoin

2013-04-09 Thread Etienne Rouxel
Hello Michael, thank you for your answer. It is written in the documentation (http://docs.sqlalchemy.org/en/rel_0_8/orm/relationships.html#sqlalchemy.orm.relationship) : > *innerjoin=False* – > > when True, joined eager loads will use an inner join to join against > related tables instead of

Re: [sqlalchemy] Relationship setup problem

2013-04-09 Thread Werner
Hi Michael, Didn't see this one before my last post. On 09/04/2013 16:19, Michael Bayer wrote: 1. is Winracku.combrack intended to be many-to-one or one-to-many ? One to many, in other words just to make sure that I don't mess up terminology, "w1" can have many children but the children only h

Re: [sqlalchemy] Unexpected SQL output for query with contains_eager and innerjoin

2013-04-09 Thread Michael Bayer
oh and also, make the join an "outer" by adding the option joinedload(RelationB.relation_c, innerjoin=False) On Apr 9, 2013, at 10:16 AM, Michael Bayer wrote: > > On Apr 9, 2013, at 8:12 AM, Etienne Rouxel wrote: > >> Hello >> >> I am wondering why the outputs q1 and q2 below are not the

Re: [sqlalchemy] Relationship setup problem

2013-04-09 Thread Werner
On 09/04/2013 14:29, Werner wrote: ... Wineracku.combrack = sao.relationship('Wineracku', remote_side=[Wineracku.id], cascade="all, delete, delete-orphan", single_parent=True) Wineracku.combrack = sao.relationship(

Re: [sqlalchemy] Relationship setup problem

2013-04-09 Thread Michael Bayer
1. is Winracku.combrack intended to be many-to-one or one-to-many ? 2. Given w1, w2: w1 = Winracku() w2 = Winracku() w1.combrack = w2 which one are you deleting first, and what is the desired behavior as a result? On Apr 9, 2013, at 8:29 AM, Werner wrote: > On 09/04/2013 13:18, Werner wrot

Re: [sqlalchemy] Unexpected SQL output for query with contains_eager and innerjoin

2013-04-09 Thread Michael Bayer
On Apr 9, 2013, at 8:12 AM, Etienne Rouxel wrote: > Hello > > I am wondering why the outputs q1 and q2 below are not the same. Is it a bug? its not a bug. You have "lazy='joined'" and "innerjoin=true" on RelationB.relation_c, and automatic joined loading isn't automated to the degree that i

Re: [sqlalchemy] Single table inheritance and __table_args__

2013-04-09 Thread Michael Bayer
this feature should be added and is http://www.sqlalchemy.org/trac/ticket/2700, here's a workaround for now: from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base class FixTableArgs(object): @classmethod def __declare_last__(cls):

Re: [sqlalchemy] automating inheritance

2013-04-09 Thread Michael Bayer
the script below is my best guess what we're talking about, it's my original test from April 20 2012, and includes an assertion that both Person and Engineer get their own tables. The script runs identically in 0.7 and 0.8, and __mapper_args__ is called in the same way in both versions. If you

Re: [sqlalchemy] Relationship setup problem

2013-04-09 Thread Werner
On 09/04/2013 13:18, Werner wrote: On 09/04/2013 12:56, Werner wrote: Hi, On 01/03/2013 15:59, Werner wrote: Hi, Found it in the doc, the "Adjacency List Relationship" is what I wanted. http://docs.sqlalchemy.org/en/latest/orm/relationships.html#adjacency-list-relationships I am having a

[sqlalchemy] Unexpected SQL output for query with contains_eager and innerjoin

2013-04-09 Thread Etienne Rouxel
Hello I am wondering why the outputs q1 and q2 below are not the same. Is it a bug? from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() _relation_a_table = Table('relation_a', Base.metadata, Column('i

Re: [sqlalchemy] Relationship setup problem

2013-04-09 Thread Werner
On 09/04/2013 12:56, Werner wrote: Hi, On 01/03/2013 15:59, Werner wrote: Hi, Found it in the doc, the "Adjacency List Relationship" is what I wanted. http://docs.sqlalchemy.org/en/latest/orm/relationships.html#adjacency-list-relationships I am having a problem when I try to delete an item

Re: [sqlalchemy] Relationship setup problem

2013-04-09 Thread Werner
Hi, On 01/03/2013 15:59, Werner wrote: Hi, Found it in the doc, the "Adjacency List Relationship" is what I wanted. http://docs.sqlalchemy.org/en/latest/orm/relationships.html#adjacency-list-relationships I am having a problem when I try to delete an item where I use this, I get this except

[sqlalchemy] Single table inheritance and __table_args__

2013-04-09 Thread Gombas, Gabor (IT)
Hi, What is the recommended method of specifying constraints on columns added by a subclass using single-table inheritance? This does not work, I get a KeyError for "col_a": class BaseClass(Base) __table__ = "base" __table_args__ = (Index("base_col"), UniqueConstrain