Re: [sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-21 Thread Oliver Palmer
> > On Tuesday 21 April 2015 09:43:51 Mike Bayer wrote: > >> On 4/21/15 6:45 AM, Guido Winkelmann wrote: > >>> On Monday 20 April 2015 21:57:40 Oliver Palmer wrote: > >>> [...] > >>> > >>>> So I got to thinking about what we'

Re: [sqlalchemy] Non backwards-compatible changes in 1.0? Lots of suddenly failing tests here.

2015-04-20 Thread Oliver Palmer
te in our tests anyway since we could couple the execution of those pragma statements more closely with the tests as they run to avoid the issue in the future. I would be curious to know if this is actually a bug in event handling though. ---Oliver On Monday, April 20, 2015 at 7:22:47 P

Re: [sqlalchemy] Routing Session and query count problem

2014-10-16 Thread Jeff Oliver
On Wednesday, October 15, 2014 2:55:22 PM UTC-7, Michael Bayer wrote: > > > The system currently locates the bind via the tables present in the > selectable, as when you bind to a mapper, the tables that the mapper > selects from are extracted and also set up. > > Issue is added at > https://

[sqlalchemy] Routing Session and query count problem

2014-10-15 Thread Jeff Oliver
I've got a problem with SQLAlchemy 0.9.8 with a Routing Session setup and using the query count method. I started from this post on Mike Bayer's blog: http://techspot.zzzeek.org/2012/01/11/django-style-database-routers-in-sqlalchemy/ I did some tweaks such that I could specify the database eng

Re: [sqlalchemy] Possible bug in MySQLDialect._check_unicode_returns() (missing optional parameter) (0.9.3 )

2014-02-21 Thread Oliver Bestwalter
Hi Jonathan, thanks, I'll do that from now on. Cheers Oliver On 21 February 2014 19:16, Jonathan Vanasco wrote: > I'd suggest recompiling mysqldb > > I've had weird/odd issues happen when either Python or MySQL/PostgreSQL > were updated and the driver wasn't.

Re: [sqlalchemy] Possible bug in MySQLDialect._check_unicode_returns() (missing optional parameter) (0.9.3 )

2014-02-21 Thread Oliver Bestwalter
Hi Michael, Am Freitag, 21. Februar 2014 13:24:05 UTC+1 schrieb Michael Bayer: > > > On Feb 21, 2014, at 7:05 AM, Oliver Bestwalter > > > wrote: > > > File > "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", > line 166, in fi

[sqlalchemy] Possible bug in MySQLDialect._check_unicode_returns() (missing optional parameter) (0.9.3 )

2014-02-21 Thread Oliver Bestwalter
kes exactly 2 arguments (3 given) for mysql this method was overridden to fix https://github.com/farcepest/MySQLdb1/commit/cd44524fef63bd3fcb71947392326e9742d520e8 but now the overriden method is is lacking the optional parameter additional_tests and crashes when called with it. I just

Re: [sqlalchemy] Execute statement after each connect.

2012-05-15 Thread Oliver Tonnhofer
Hi Simon, On Mon, May 14, 2012 at 7:26 PM, Simon King wrote: >  http://docs.sqlalchemy.org/en/rel_0_7/core/events.html#sqlalchemy.events.PoolEvents.connect > > 'connect' event handlers look like this: > >  connect(dbapi_connection, connection_record) > > Can't you use the dbapi_connection to call

[sqlalchemy] Execute statement after each connect.

2012-05-14 Thread Oliver Tonnhofer
the event API, but the `connect` event does not give me a Connection to execute the statement. Are there any other options? Regards, Oliver -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on

[sqlalchemy] Re: get unique property from model

2011-07-22 Thread Oliver Christen
olumn ' + columns.name + ' has unique contraint' is there a better way to do that ? On Jul 22, 11:54 am, Oliver Christen wrote: > hello all > > Im tring to find a way to extract from the model which colums have the > attribute "unique" set, but after reading the documenta

[sqlalchemy] get unique property from model

2011-07-22 Thread Oliver Christen
find the column with unique=True ??? thanks in advance best regards Oliver -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send

[sqlalchemy] (OperationalError) (1066, "Not unique table/alias: '...'") when selecting only from a joined table

2011-06-28 Thread Oliver
I want to have the following query in sqlalchemy: SELECT t_objects_1.tid AS t_objects_1_tid FROM t_objects AS t_objects_2 INNER JOIN c_objects AS c_objects_1 ON t_objects_2.tid = c_objects_1.tid INNER JOIN t_objects AS t_objects_1 ON t_objects_1.tid = t_objects_2.parent_id WHERE c.id = 1; this wo

[sqlalchemy] Re: session.execute w/ list of values instead of dict?

2011-06-23 Thread Wells Oliver
Hmm, new to SQLAlchemy here, but if I want transactions, then I need to go the Session route, correct? On Jun 23, 2:48 pm, Michael Bayer wrote: > On Jun 23, 2011, at 5:08 PM, Wells Oliver wrote: > > > W/ psycopg2, you can do a cursor.execute(query, list) where list is an > >

[sqlalchemy] session.execute w/ list of values instead of dict?

2011-06-23 Thread Wells Oliver
W/ psycopg2, you can do a cursor.execute(query, list) where list is an actual python list of values : [1,2,3] W/ SQLAlchemy, it seems the session.execute(query, values) will only accept a dictionary for values. Am I missing something? Can I pass a list instead? Thanks. -- You received this messa

[sqlalchemy] Re: INSERT…RETURNING being issued wro ngly

2010-08-22 Thread Oliver Beattie
Figured it out. I had two self-referential foreign keys on the table, both pointing (obviously) to the primary key, but for some reason I was specifying foreign_keys to the relations, I just removed these arguments to the relations and this has resolved itself. On Aug 19, 12:28 pm, Oliver Beattie

[sqlalchemy] Re: INSERT…RETURNING being issued wro ngly

2010-08-19 Thread Oliver Beattie
hael Bayer wrote: > On Aug 18, 2010, at 12:29 PM, Oliver Beattie wrote: > > > > > > > On Aug 18, 3:39 pm, Michael Bayer wrote: > >> Sent from my iPhone > > >> On Aug 18, 2010, at 8:27 AM, Oliver Beattie wrote: > > >>> I'm not entir

[sqlalchemy] Re: INSERT…RETURNING being issued wro ngly

2010-08-18 Thread Oliver Beattie
On Aug 18, 3:39 pm, Michael Bayer wrote: > Sent from my iPhone > > On Aug 18, 2010, at 8:27 AM, Oliver Beattie wrote: > > > > > > > I'm not entirely sure why this is happening… it seems to work for me > > in nearly all other circumstances so I'm a bi

[sqlalchemy] Re: INSERT…RETURNING being issued wro ngly

2010-08-18 Thread Oliver Beattie
I'm using Postgres On Aug 18, 1:27 pm, Oliver Beattie wrote: > I'm not entirely sure why this is happening… it seems to work for me > in nearly all other circumstances so I'm a bit stumped. Basically, I > have a declarative table which has a character field as its prima

[sqlalchemy] INSERT…RETURNING being issued wrongly

2010-08-18 Thread Oliver Beattie
I'm not entirely sure why this is happening… it seems to work for me in nearly all other circumstances so I'm a bit stumped. Basically, I have a declarative table which has a character field as its primary key (it's not an ID which can be returned by the server), yet SQLAlchemy is issuing an INSERT

[sqlalchemy] Re: INSERT…RETURNING being issued wro ngly

2010-08-18 Thread Oliver Beattie
I'm using Postgres, by the way. On Aug 18, 1:27 pm, Oliver Beattie wrote: > I'm not entirely sure why this is happening… it seems to work for me > in nearly all other circumstances so I'm a bit stumped. Basically, I > have a declarative table which has a character fi

[sqlalchemy] Comparable properties

2010-07-07 Thread Oliver Beattie
Hi, I am just wondering if it is possible to allow a declarative object to have some of its properties comparable as if they were ClauseElements. I know I'm not explaining myself terrifically well here, but consider the following property: @property def is_visible(self): return (self.

[sqlalchemy] Passing multiple keys to undefer()

2010-07-02 Thread Oliver Beattie
Hi there, The documentation for the undefer() method seems to indicate that it should be able to accept multiple positional arguments for keys, however trying this results in an error. I wanted to post this here to check I'm right in thinking this before I file a ticket. The docs give the signatur

Re: [sqlalchemy] Abridged summary of sqlalchemy@googlegroups.com - 14 Messages in 7 Topics

2010-06-14 Thread Oliver Beattie
Aa Sent from my iPhone On Jun 14, 2010, at 12:39 AM, "sqlalchemy+nore...@googlegroups.com" < sqlalchemy+nore...@googlegroups.com> wrote: Today's Topic Summary Group: http://groups.google.com/group/sqlalchemy/topics - Multiple databases or multiple schemas? <#group_thread_0> [2 Updates]

[sqlalchemy] Re: UnicodeEncodeError driving me mad

2010-05-11 Thread Oliver Beattie
n option to change that > (you really should change it if possible), then SQLA's usual "encode to > utf-8" logic can be re-established on 0.6 by also adding > "use_native_unicode=False". > > Docs > athttp://www.sqlalchemy.org/docs/reference/dialects/po

[sqlalchemy] UnicodeEncodeError driving me mad

2010-05-11 Thread Oliver Beattie
I have some code that is taking values out of one database (a MySQL latin-1 database) and inserting them into another (postgres, utf-8) database, and I can't for the life of me work out what is going wrong here. The traceback looks slightly fishy, so I can only assume something is going horribly wr

[sqlalchemy] Two subclasses (single table inheritance) both requiring the same columns

2010-05-07 Thread Oliver Beattie
m as the same attribute on the mapper, but I really need the ability to query against that column across the different mappers (without having to do an OR). Is there a way around this? Any help would be appreciated :) Thanks, Oliver -- You received this message because you are subscribed to the

[sqlalchemy] Re: Getting access to the object being updated inside a default callable?

2010-03-05 Thread Oliver Beattie
influences", they cease to be "column-level defaults". On Mar 5, 2:48 pm, "Michael Bayer" wrote: > Oliver Beattie wrote: > > Sorry to bug I imagine there is no way of doing this, but would be > > good to know for sure. If not, this would be really usefu

[sqlalchemy] Re: Getting access to the object being updated inside a default callable?

2010-03-05 Thread Oliver Beattie
Sorry to bug… I imagine there is no way of doing this, but would be good to know for sure. If not, this would be really useful functionality. For instance, I might want to populate one column based on the contents of one of more other columns. On 12 Jan, 11:21, Oliver Beattie wrote: > Hi th

[sqlalchemy] Re: How to make relation to same table

2010-02-23 Thread Oliver Beattie
You probably want to take a look at http://www.sqlalchemy.org/docs/05/mappers.html#adjacency-list-relationships On Feb 23, 5:42 pm, flya flya wrote: > here is code: > > Base = declarative_base() > class Page(Base): >    __tablename__ = 'pages' >    id = Column(Integer, primary_key=True) >    pare

[sqlalchemy] Re: Multiple relations to the same table in a base declarative class causes errors when querying

2010-02-23 Thread Oliver Beattie
Ah, thanks so much. Guess sometimes you just need a second pair of eyes to spot where you've messed it up :) On Feb 23, 7:29 pm, Michael Bayer wrote: > On Feb 23, 2010, at 1:03 PM, Oliver Beattie wrote: > > > Hi all, > > > I've run into something I can'

[sqlalchemy] Multiple relations to the same table in a base declarative class causes errors when querying

2010-02-23 Thread Oliver Beattie
ne. I'm not entirely sure what I should do next to try and fix this? As always, help greatly appreciated :) —Oliver -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To un

[sqlalchemy] Getting access to the object being updated inside a default callable?

2010-01-12 Thread Oliver Beattie
s that DBObject instance inside the default function? I see it gets passed an ExecutionContext instance, but I don't see a way to get the object from there :\ If there's a way to do this, it would help me a lot :) Thanks, Oliver -- You received this message because you are subscr

[sqlalchemy] Functions on results of subquery question

2009-11-27 Thread Oliver Beattie
if someone could possibly help me out, I'd be most grateful. Thanks, Oliver Beattie -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send em

[sqlalchemy] Re: Multiple relations to the same tabl e using declarative… I think I'm being a total idiot

2009-11-11 Thread Oliver Beattie
And we have a winner. Always check you are actually passing the values to the class constructor that you think you are before posting in a public group, folks. I've think I've succeeded in humiliating myself for today… On Nov 11, 11:52 am, Oliver Beattie wrote: > Hi all, > >

[sqlalchemy] Multiple relations to the same table us ing declarative… I think I'm being a total idiot

2009-11-11 Thread Oliver Beattie
ntegrityError: (IntegrityError) null value in column "sender_id" violates not-null constraint" (even though [at least as far as I am concerned] the column is not empty). I know when I find the answer to this I'm going to feel

[sqlalchemy] Re: What happens if a session is closed inside a subtransaction?

2009-10-16 Thread Oliver Beattie
I should probably ask something else too… how much overhead is there in using subtransactions as opposed to one "global" transaction? On Oct 14, 3:18 pm, "Michael Bayer" wrote: > Oliver Beattie wrote: > > > Hi All, > > > I'm just wonderin

[sqlalchemy] Re: What happens if a session is closed inside a subtransaction?

2009-10-16 Thread Oliver Beattie
saction. I don't know as that's the best way to do it, but it does eliminate a lot of try...except...else's since I do need the explicit subtransaction stuff. In any case, thanks for clearing that up for me, and it's good to know about those accessors. On Oct 14, 3:18 pm, "

[sqlalchemy] What happens if a session is closed inside a subtransaction?

2009-10-14 Thread Oliver Beattie
il, sorry) I imagine that it does indeed abort all parent transactions. If so, is there any way to tell whether the session is "in a subtransaction state" or not, so I could only call close() if it is the "root"? Sorry if this is a bit confusing or if I&#