[sqlalchemy] Re: wx and SqlAlchemy

2008-08-29 Thread Werner F. Bruhin
Mike, Mike wrote: I found the issue. For some reason, SqlAlchemy is passing a unicode string to a varchar field in SQL Server, which is causing an error to be raised. If I explicitly set the value to an integer or a string, it works fine. I'm not sure how it's getting cast to unicode,

[sqlalchemy] Re: Orphans not deleted using cascade parameter

2008-08-29 Thread Michael Brickenstein
Hi! Hi have a similar problem using table reflection a la sqlsoup. My DB Backend ist postgresql 8.3. I have a many to many relation: orms5=# \d project_programming_language Table public.project_programming_language Column | Type | Modifiers

[sqlalchemy] max(datetime) does not return a datetime. Bug or feature ?

2008-08-29 Thread Remi Jolin - SysGroup
Hello, consider the following (Elixir syntax sorry) class A(Entity): creation_date = Field(DateTime) ... A.query().max(A.creation_date) returns a unicode and not a datetime as max([a.creation_date for a in A.query()]) returns Is it a bug ? (sqlalchemy version 0.4.6)

[sqlalchemy] Replacement for query.mapper.class_

2008-08-29 Thread Paul Johnston
Hi, Hope everyone is well, not been around for a while. I've noticed one of my apps has broken with an SA upgrade. It was using query.mapper.class_ to determine the class from a query, but query.mapper no longer exists. What's the 0.5 way of doing this? Paul

[sqlalchemy] Re: Orphans not deleted using cascade parameter

2008-08-29 Thread Michael Brickenstein
I forgot to mention, that I use 0.5.0beta 3. --~--~-~--~~~---~--~~ 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] Re: Replacement for query.mapper.class_

2008-08-29 Thread az
see query._mapper_zero(), _only_mapper_zero(), _mapper_zero_or_none() On Friday 29 August 2008 11:32:30 Paul Johnston wrote: Hi, Hope everyone is well, not been around for a while. I've noticed one of my apps has broken with an SA upgrade. It was using query.mapper.class_ to determine the

[sqlalchemy] Re: Orphans not deleted using cascade parameter

2008-08-29 Thread Alex Mathieu
Hi Michael, I had the same problem for a while. I'm not exactly sure what I did in order to fix this (have 2 ideas in my mind, need to figure out which of it it was). As soon as I remember, I'll let you know. On Aug 29, 1:44 am, Michael Brickenstein [EMAIL PROTECTED] wrote: Hi! Hi have a

[sqlalchemy] Re: wx and SqlAlchemy

2008-08-29 Thread Mike
Werner, On Aug 29, 2:21 am, Werner F. Bruhin [EMAIL PROTECTED] wrote: Mike, Mike wrote: I found the issue. For some reason, SqlAlchemy is passing a unicode string to a varchar field in SQL Server, which is causing an error to be raised. If I explicitly set the value to an

[sqlalchemy] Re: wx and SqlAlchemy

2008-08-29 Thread Mike
Werner, On Aug 29, 2:21 am, Werner F. Bruhin [EMAIL PROTECTED] wrote: Mike, Mike wrote: I found the issue. For some reason, SqlAlchemy is passing a unicode string to a varchar field in SQL Server, which is causing an error to be raised. If I explicitly set the value to an

[sqlalchemy] Unicode not getting translated to SQL Server?

2008-08-29 Thread Mike
Hi, I have a weird issue wherein I send a unicode string to SQL Server 2000 using SqlAlchemy in a wxPython program. A little history would probably help: I created a timesheet program last year using wxPython and connected to my databases using pymssql. In the hopes of making this program more

[sqlalchemy] Re: Orphans not deleted using cascade parameter

2008-08-29 Thread Michael Bayer
Unfortunately, without an illustration of your usage pattern, we can't assist with your issue.Here's the same test case again from earlier in the thread. Can you modify it to look like your failing condition ? rom sqlalchemy import * from sqlalchemy.orm import * from

[sqlalchemy] Re: Unicode not getting translated to SQL Server?

2008-08-29 Thread Michael Bayer
On Aug 29, 2008, at 10:53 AM, Mike wrote: If I use pymssql instead, it works. As I understand it, SA should be using pymssql anyway, so I don't know why this is happening. I can cast the unicode to a string, so it's not a big deal. However, I thought someone might want to know that this is

[sqlalchemy] Constructors not called?

2008-08-29 Thread andrew cooke
Hi, Not sure if I'm misunderstanding what's happening, whether I have a bug, or whether this is normal behaviour, but as far as I can tell mapped objects that are returned from a query do not have their constructor called. Is that correct? In a bit more detail - I have a mapping defined to

[sqlalchemy] Re: Extension Mapper

2008-08-29 Thread GustaV
You must be right. Of course, Turbogears2 already add an extension to the session, and it looks like it is not a list of extension anyway (or maybe in the latest trunk?). What the best way then? To subclass the tg2 extension with mine and continue to call overloaded method from mine? Anything

[sqlalchemy] Re: Constructors not called?

2008-08-29 Thread Michael Bayer
On Aug 29, 2008, at 11:22 AM, andrew cooke wrote: Hi, Not sure if I'm misunderstanding what's happening, whether I have a bug, or whether this is normal behaviour, but as far as I can tell mapped objects that are returned from a query do not have their constructor called. Is that

[sqlalchemy] Re: Unicode not getting translated to SQL Server?

2008-08-29 Thread Mike
Hi Mr. Bayer, On Aug 29, 10:10 am, Michael Bayer [EMAIL PROTECTED] wrote: On Aug 29, 2008, at 10:53 AM, Mike wrote: If I use pymssql instead, it works. As I understand it, SA should be using pymssql anyway, so I don't know why this is happening. I can cast the unicode to a string, so

[sqlalchemy] Re: Unicode not getting translated to SQL Server?

2008-08-29 Thread Rick Morrison
and then I do the following where someValue happens to be a unicode string: pref.pref_value = someValue session.commit() That's not going to work with pymssql as your DBAPI. Pymssql is based on Microsoft's DBLib (circa 1991 or so), which does not support unicode and never will: it's been

[sqlalchemy] Re: Unicode not getting translated to SQL Server?

2008-08-29 Thread Mike
Hi Rick, On Aug 29, 11:02 am, Rick Morrison [EMAIL PROTECTED] wrote: and then I do the following where someValue happens to be a unicode string: pref.pref_value = someValue session.commit() That's not going to work with pymssql as your DBAPI. Pymssql is based on Microsoft's DBLib

[sqlalchemy] Re: Extension Mapper

2008-08-29 Thread Michael Bayer
On Aug 29, 2008, at 11:36 AM, GustaV wrote: You must be right. Of course, Turbogears2 already add an extension to the session, and it looks like it is not a list of extension anyway (or maybe in the latest trunk?). What the best way then? To subclass the tg2 extension with mine and

[sqlalchemy] Re: Extension Mapper

2008-08-29 Thread Michael Bayer
in r5069, extension can be a list of SessionExtension objects. You can also append to session.extensions. On Aug 29, 2008, at 11:36 AM, GustaV wrote: You must be right. Of course, Turbogears2 already add an extension to the session, and it looks like it is not a list of extension

[sqlalchemy] timing all queries

2008-08-29 Thread qvx
Is there a way to record the execution time for all queries issued by sqlalchemy? Thanks, Tvrtko --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to