[sqlalchemy] Re: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-21 Thread Harish K Vishwanath
Hello Michael, Thanks for your input! I got the latest trunk from SVN. However, if my app specific baseclass is an old style class, it still breaks., this time in orm\attributes.py Traceback (most recent call last): File SqlDB_Test.py, line 9, in ? dbo =

[sqlalchemy] Re: Non UTF8 strings retreived via mapped class - 0.5beta3

2008-08-21 Thread William Temperley
It looks pretty clear that this is a Django error. It's calling str(s) which will fail for a unicode object which contains multibyte characters, which would be the case for a UTF-8 encoded string converted to unicode by SQLAlchemy.. It clearly isn't a Django error! Python Shell:

[sqlalchemy] Could there be a behavioural difference in user defined DataTypes?

2008-08-21 Thread Harish K Vishwanath
Hello, I have a class defining our own data type : class RsiSqliteDateTimeType(types.TypeEngine): def __init__(self): pass def get_col_spec(self): return VARCHAR(35) def convert_bind_param(self, value, engine): if value != None: return

[sqlalchemy] Re: problem with ExtensionMapper

2008-08-21 Thread naktinis
Ok, so the problem might be because the first test fails while doing Session.clear(): Traceback (most recent call last): File .../tests/__init__.py, line 35, in tearDown Session.clear() File /usr/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/ sqlalchemy/orm/scoping.py, line 98,

[sqlalchemy] Re: declarative

2008-08-21 Thread Jim Jones
On Tue, 2008-08-19 at 16:16 -0400, Michael Bayer wrote: On Aug 19, 2008, at 4:07 PM, Gaetan de Menten wrote: Simpler than Elixir? How so? If you are speaking about the internal guts, then you are right declarative is simpler (which is normal since it does less), but if you meant the

[sqlalchemy] Cascading delete

2008-08-21 Thread Bob Farrell
Hi there, I spoke with zzzeek_ on IRC yesterday re: some code I'd written for an introspective cascading delete function. We were previously using the ORM to do this for us but, due to the way it works, it was taking several minutes to delete large amounts of second-generation orphans. The code

[sqlalchemy] composites

2008-08-21 Thread az
hi i plan to implement embedded structures in dbcook (as opposed to referenced structures living in separate tables), and composite props seems to fit nicely. the idea is to achieve something like: class Point( embeddableBase): x = Int() y = Int() class Vertex( base): p1 = Point() p2 =

[sqlalchemy] Re: Cascading delete

2008-08-21 Thread stephen emslie
Hi Bob Looks like you're doing some fun thinking :) Steve On Thu, Aug 21, 2008 at 11:04 AM, Bob Farrell [EMAIL PROTECTED] wrote: Hi there, I spoke with zzzeek_ on IRC yesterday re: some code I'd written for an introspective cascading delete function. We were previously using the ORM to

[sqlalchemy] Listening append() and remove()

2008-08-21 Thread GustaV
Hi all! I'm looking for an easy way to get informed when someone append or remove an object from a specific one-to-many relation. For example to keep a count on the parent object, with no need to query the children. There are a lot of stuff about it, but I'm not sure how to do it really: - 1st :

[sqlalchemy] Re: declarative

2008-08-21 Thread Gaetan de Menten
On Thu, Aug 21, 2008 at 2:06 PM, Jim Jones [EMAIL PROTECTED] wrote: On Tue, 2008-08-19 at 16:16 -0400, Michael Bayer wrote: On Aug 19, 2008, at 4:07 PM, Gaetan de Menten wrote: Simpler than Elixir? How so? If you are speaking about the internal guts, then you are right declarative is

[sqlalchemy] Re: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-21 Thread jason kirtland
Thanks for the traceback. Give r5050 a try. Cheers, Jason Harish K Vishwanath wrote: Hello Michael, Thanks for your input! I got the latest trunk from SVN. However, if my app specific baseclass is an old style class, it still breaks., this time in orm\attributes.py Traceback (most

[sqlalchemy] Re: Non UTF8 strings retreived via mapped class - 0.5beta3

2008-08-21 Thread Michael Bayer
On Aug 21, 2008, at 5:02 AM, William Temperley wrote: It looks pretty clear that this is a Django error. It's calling str(s) which will fail for a unicode object which contains multibyte characters, which would be the case for a UTF-8 encoded string converted to unicode by SQLAlchemy..

[sqlalchemy] Re: Could there be a behavioural difference in user defined DataTypes?

2008-08-21 Thread Michael Bayer
On Aug 21, 2008, at 5:07 AM, Harish K Vishwanath wrote: Hello, I have a class defining our own data type : class RsiSqliteDateTimeType(types.TypeEngine): def __init__(self): pass def get_col_spec(self): return VARCHAR(35) def convert_bind_param(self,

[sqlalchemy] Re: problem with ExtensionMapper

2008-08-21 Thread Michael Bayer
On Aug 21, 2008, at 7:02 AM, naktinis wrote: Ok, so the problem might be because the first test fails while doing Session.clear(): Traceback (most recent call last): File .../tests/__init__.py, line 35, in tearDown Session.clear() File

[sqlalchemy] Re: Listening append() and remove()

2008-08-21 Thread Michael Bayer
On Aug 21, 2008, at 9:19 AM, GustaV wrote: Hi all! I'm looking for an easy way to get informed when someone append or remove an object from a specific one-to-many relation. For example to keep a count on the parent object, with no need to query the children. There are a lot of stuff about

[sqlalchemy] Re: problem with ExtensionMapper

2008-08-21 Thread Michael Bayer
On Aug 21, 2008, at 10:45 AM, Michael Bayer wrote: On Aug 21, 2008, at 7:02 AM, naktinis wrote: Ok, so the problem might be because the first test fails while doing Session.clear(): Traceback (most recent call last): File .../tests/__init__.py, line 35, in tearDown Session.clear()

[sqlalchemy] Re: composites

2008-08-21 Thread az
On Thursday 21 August 2008 17:57:31 Michael Bayer wrote: On Aug 21, 2008, at 9:03 AM, [EMAIL PROTECTED] wrote: hi i plan to implement embedded structures in dbcook (as opposed to referenced structures living in separate tables), and composite props seems to fit nicely. the idea is to

[sqlalchemy] Re: composites

2008-08-21 Thread Eric Lemoine
Mike, a question related to you saying composites aren't a necessary feature in the first place. Would it be possible using just Python properties and synonym() to do something similar to the composites example in the doc, namely query(Vertex).filter(Vertex.start == Point(3, 4))? Thanks. Eric

[sqlalchemy] Re: composites

2008-08-21 Thread Eric Lemoine
Just realized that my question is similar to az's :) Eric 2008/8/21, Eric Lemoine [EMAIL PROTECTED]: Mike, a question related to you saying composites aren't a necessary feature in the first place. Would it be possible using just Python properties and synonym() to do something similar to the

[sqlalchemy] Re: composites

2008-08-21 Thread az
On Thursday 21 August 2008 17:57:31 Michael Bayer wrote: On Aug 21, 2008, at 9:03 AM, [EMAIL PROTECTED] wrote: hi i plan to implement embedded structures in dbcook (as opposed to referenced structures living in separate tables), and composite props seems to fit nicely. the idea is to

[sqlalchemy] Concatenating column names and text() clauses

2008-08-21 Thread Jeff
Hello. I'm trying to writing something to generate full text searches for postgres. Here's the function I've got so far: from sqlalchemy import sql import operator def full_text(fields, text): def alternate(items): for i in items[:-1]: yield i yield

[sqlalchemy] Re: Concatenating column names and text() clauses

2008-08-21 Thread az
if u start with the text, would it work? text(abc) + column text(abc) + text(dsa) text(abc) + column + text(abc) text(abc) + column1 + column2 On Thursday 21 August 2008 23:28:54 Jeff wrote: Hello. I'm trying to writing something to generate full text searches for postgres. Here's the

[sqlalchemy] Re: declarative

2008-08-21 Thread Jim Jones
On Thu, 2008-08-21 at 16:08 +0200, Gaetan de Menten wrote: Everyone else will eventually grow out of it. That's quite a bold claim... Ok, Elixir is not your style, that's fine. Also, Elixir certainly doesn't suit every project out there, I'm aware of that. But implying it's not worth it

[sqlalchemy] Re: declarative

2008-08-21 Thread az
well, if u want something that looks simpler but is actualy quite more complex/twisted inside, try dbcook.sf.net. it tries to hide _all the sql-schema stuff for u. but it's definitely not for faint-hearted, no time to brush it up... even the examples look like a battle field.

[sqlalchemy] Re: Concatenating column names and text() clauses

2008-08-21 Thread Michael Bayer
On Aug 21, 2008, at 4:28 PM, Jeff wrote: Hello. I'm trying to writing something to generate full text searches for postgres. Here's the function I've got so far: from sqlalchemy import sql import operator def full_text(fields, text): def alternate(items): for i in

[sqlalchemy] Re: Code working on SQLA 0.4.6 is breaking on SQLA 0.5beta3

2008-08-21 Thread Harish K Vishwanath
Thanks Jason. Downloaded R5051, it works fine! Cheers, Harish On Thu, Aug 21, 2008 at 7:58 PM, jason kirtland [EMAIL PROTECTED] wrote: Thanks for the traceback. Give r5050 a try. Cheers, Jason Harish K Vishwanath wrote: Hello Michael, Thanks for your input! I got the latest trunk

[sqlalchemy] Facing Invalid Request Error in 0.5beta4r5051

2008-08-21 Thread Harish K Vishwanath
Hello, I am getting a sa.exc.InvalidRequestError in SALA 0.5beta4, which never happened in SQLA 0.4.6 SQLA 0.4.6 : sqlalchemy.orm.sessionmaker(bind=None, autoflush=False, transactional=True) SQLA 0.5beta4 : sqlalchemy.orm.sessionmaker(bind=None, autoflush=False, autocommit=False) Apart from

[sqlalchemy] Fwd: Facing Invalid Request Error in 0.5beta4r5051

2008-08-21 Thread Harish K Vishwanath
The error goes away when I make the session expire_on_commit=False., But its a nice feature to have, how can I fix the exception below retaining this feature? -- Forwarded message -- From: Harish K Vishwanath [EMAIL PROTECTED] Date: Fri, Aug 22, 2008 at 11:04 AM Subject: Facing