[sqlalchemy] Re: pymssql and encoding - I can not get \x92 to be an '

2007-04-10 Thread Rick Morrison
...and while I'm making this thread unnecessarily long, I should add that while pymssql may not understand Unicode data, the pyodbc DB-API interface does. Thanks to recent work by Paul Johnston, it's on fast-track to becoming the preferred MSSQL db-api for SA. On 4/10/07, Rick Morrison <[EMAIL PR

[sqlalchemy] Re: 'PropertyLoader' object has no attribute 'strategy'

2007-04-10 Thread Roger Demetrescu
Some details I forgot to mention: I'm using: * SQLAlchemy 0.3.6 * Postgresql 7.3.4 * Linux RedHat kernel 2.4.20-8 Other important detail: looking at my log files, I noticed that the message: global name 'anxnews_urllocal' is not defined appears several hours after the message: 'P

[sqlalchemy] 'PropertyLoader' object has no attribute 'strategy'

2007-04-10 Thread Roger Demetrescu
Hi all, I have a daemon with 2 threads to control upload / download of some files (they use SQLAlchemy to find out which files must be worked). Once a week, my daemon's logging system sends me an email with this message: 'PropertyLoader' object has no attribute 'strategy' After that, I r

[sqlalchemy] Re: pymssql and encoding - I can not get \x92 to be an '

2007-04-10 Thread Rick Morrison
Arghh, that last bit should be chr(146), not ord(146) On 4/10/07, Rick Morrison <[EMAIL PROTECTED]> wrote: > > You've got hi-bit characters in your data. MSSQL with pymssql will store > this, but not understand it. > > You most likely are looking for a "normal" ASCII apostrophe (i.e. ord(39)) >

[sqlalchemy] Re: pymssql and encoding - I can not get \x92 to be an '

2007-04-10 Thread Rick Morrison
You've got hi-bit characters in your data. MSSQL with pymssql will store this, but not understand it. You most likely are looking for a "normal" ASCII apostrophe (i.e. ord(39)) instead of the hi-bit version you've got. to get it, try ${str}.replace(ord(146), "'")<-- that last bit is a single

[sqlalchemy] pymssql and encoding - I can not get \x92 to be an '

2007-04-10 Thread [EMAIL PROTECTED]
Hello all - Unfortunately, we have a ms sql server at work. When I get tuples from the server they look like this: .. (55, 26, 'Small Business and Individual Chapter 11s - The NewCode \x92s Effect on Strategies', 'AUDIO'... with \x92 for apostrophe etc. I've tried putting every encoding in the

[sqlalchemy] Re: just what does 'delete-orphan' bring us ?

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 2:12 PM, Frederic Vander Elst wrote: > > Hello List, > > I have two (related) questions hiding below: > > The enclosed code makes mappers with (edit + re-run please) > > . default cascade rules > . cascade='all' > . cascade='all, delete-orphan' > > It tries to test > > u =

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread Michael Bayer
hm, why is from_attr a classmethod ? not very consistent with all the other generative methods ? can we have a regular generative method as well ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "sqlalchemy"

[sqlalchemy] Re: Aliasing within functions for eager loads

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 11:36 AM, Rick Morrison wrote: > I've noticed that if you specify a "primaryjoin" criteria for a > mapper relationship, SA automatically aliases the table/column > names when doing an eager load of that relationship. > > But this doesn't seem to work if within that primar

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 10:22 AM, Gaetan de Menten wrote: > In case anybody is interested, here is my patch slightly modified with > what you suggest above. Now it works wonders for both lazy and eager > relationships. There is something ugly about it though: imports. I > have to import the LazyLoad

[sqlalchemy] just what does 'delete-orphan' bring us ?

2007-04-10 Thread Frederic Vander Elst
Hello List, I have two (related) questions hiding below: The enclosed code makes mappers with (edit + re-run please) . default cascade rules . cascade='all' . cascade='all, delete-orphan' It tries to test u = User(); e = Email(); u.append(e) ; sess.fluhs() # works always session.delete

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread Gaetan de Menten
On 4/10/07, svilen <[EMAIL PROTECTED]> wrote: > can u give some exampe, how this is supposed to be used (finaly)? > as relation and/or directly as Query() Attached is a simple example. The setup is done using Elixir but the actual Query.from_attr usage would be the same with plain SA. If you real

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread svilen
can u give some exampe, how this is supposed to be used (finaly)? as relation and/or directly as Query() On Tuesday 10 April 2007 17:22:45 Gaetan de Menten wrote: > On 3/31/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > On Mar 31, 2007, at 1:17 PM, Gaetan de Menten wrote: > > > That's approxima

[sqlalchemy] Aliasing within functions for eager loads

2007-04-10 Thread Rick Morrison
I've noticed that if you specify a "primaryjoin" criteria for a mapper relationship, SA automatically aliases the table/column names when doing an eager load of that relationship. But this doesn't seem to work if within that primary join, a column is referenced inside of a .func; SA leaves the "na

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-04-10 Thread Gaetan de Menten
On 3/31/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Mar 31, 2007, at 1:17 PM, Gaetan de Menten wrote: > > > That's approximately what I did in my patch with the new "params" > > keyword argument, except I only implemented the "set" operation, not > > the add operation on the params. Anyway,

[sqlalchemy] Re: problems with threadlocal strategy and ResultProxy

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 7:44 AM, Manlio Perillo wrote: > > Yes. > From the documentation it is not clear if this is allowed. > the word "threadlocal" means that a resource is tied to the current thread. therefore, if you take resources which expect this behavior and then send them off to thre

[sqlalchemy] Re: About threadlocal strategy

2007-04-10 Thread Michael Bayer
On Apr 10, 2007, at 5:33 AM, Koen Bok wrote: > > I'm trying to wrap my head around the threadlocal plugin to decide if > we need it for our app. you dont. dont use it. if it requires any kind of head wrapping, then thats why i ripped it out of the core...youre better off designing your o

[sqlalchemy] Re: Putting Session.flush in a seperate thread

2007-04-10 Thread Michael Bayer
just deal with the session, and bind it to an engine. saying "engine.connect()" does nothing down there since you arent holding onto anything. the engine itself is stateless with regards to connections (unless you use the threadlocal strategywhich you shouldnt). On Apr 10, 2007, at

[sqlalchemy] Re: About threadlocal strategy

2007-04-10 Thread HD Mail
Koen Bok wrote: > I'm trying to wrap my head around the threadlocal plugin to decide if > we need it for our app. We are building a GUI point of sale system. > Until now I have done everything in sessions, basically in one global > shared session. I have read all of the documentation about the > t

[sqlalchemy] Re: Opinion on correct use of Sqlalchemy

2007-04-10 Thread HD Mail
Michael Bayer wrote: > On Apr 9, 2007, at 10:06 PM, Huy Do wrote: > > >> Michael Bayer wrote: >> >>> Particularly for your query you are doing an eager load between >>> "asset" and "location" yet a lot of your query criterion depends upon >>> "location", so in that sense yes you have to us

[sqlalchemy] Re: problems with threadlocal strategy and ResultProxy

2007-04-10 Thread Manlio Perillo
Michael Bayer ha scritto: > id very much prefer a test case that isnt using Twisted since Ive no > idea what twisted does with threads. Well, all we need to know, in this example, is that the queries are executed always in one separate thread (and always the same). So, the cursors (ResultPr

[sqlalchemy] Re: (solved) Automatic generation of changelog

2007-04-10 Thread Arnar Birgisson
Hi all, I have this working to my liking and as promised, here's the code: It's not complete since I'm omitting some of my model and just showing you the relevant parts. This is my model: verkefni = Table("verkefni", metadata, Column("verkefni", Integer, primary_key=True), Column("skra

[sqlalchemy] About threadlocal strategy

2007-04-10 Thread Koen Bok
I'm trying to wrap my head around the threadlocal plugin to decide if we need it for our app. We are building a GUI point of sale system. Until now I have done everything in sessions, basically in one global shared session. I have read all of the documentation about the threadlocal strategy but I

[sqlalchemy] Re: SQLite and decimal.Decimal

2007-04-10 Thread [EMAIL PROTECTED]
It would be great. Thank you. André On 7 abr, 12:57, Michael Bayer <[EMAIL PROTECTED]> wrote: > the thing is, we have support for 6 different databases and postgres > is the *only* one where its DBAPI implementation decides to use > "Decimal" for numeric types. the rest return just floats. tha

[sqlalchemy] Re: Putting Session.flush in a seperate thread

2007-04-10 Thread Koen Bok
> the elegant way would be to not worry about the thread scope of a > connection and just use connection pooling normally. pull out a > connection when needed, close it when complete (which is really just > a return to the connection pool). keep the scope of those two > operations local

[sqlalchemy] Re: Designing a permission system

2007-04-10 Thread Andrew Stromnov
look at http://code.google.com/p/spiff/ - SpiffGuard On Apr 10, 11:36 am, "Kaali" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm designing a permission system to our messaging platform. The > platform has different channels which contains messages. Every > different user can have different permissions

[sqlalchemy] Designing a permission system

2007-04-10 Thread Kaali
Hi, I'm designing a permission system to our messaging platform. The platform has different channels which contains messages. Every different user can have different permissions on a channel. The permissions are create, modify, delete. With these permissions, we can define that some users can c