[sqlalchemy] Re: date format

2007-02-01 Thread Guy Hulbert
On Thu, 2007-01-02 at 07:53 +0100, jose wrote: Thank you Guy to answer my question. I know I can use the strftime property of datetime to format my dates as: qry.data_inizio.strftime('%d/%m/%Y') but what I'm looking for, is a way to setting date style in SA or psycopg2 whithout need

[sqlalchemy] Re: Tool to check whether DB matches model

2007-02-01 Thread Paul Johnston
Hi, Well, I see a model as a set of tables. In this particular case, a model is the set of tables created with a particular MetaData object. I guess model is a term from the MVC world, so perhaps there's a better term for SA users. Paul On 1/30/07, Michael Bayer [EMAIL PROTECTED] wrote:

[sqlalchemy] r2285 breaks some lazy loading

2007-02-01 Thread svilen
Here last version of the all*AB testcase. 2284 is ok. 2285 - no. --~--~-~--~~~---~--~~ 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

[sqlalchemy] about cascade rule

2007-02-01 Thread Manlio Perillo
Hi. I still do not fully understand cascade rules, however I want to be sure the behaviour below is a feature and not a bug. Here is the code: from sqlalchemy import * db = create_engine('postgres://manlio:[EMAIL PROTECTED]/test', echo=False) metadata = BoundMetaData(db) a = Table(

[sqlalchemy] MapperExtension with options

2007-02-01 Thread Dennis
I wanted to experiment with using a MapperExtension to add a couple of non-mapped properties to a class at load time. def MyExt(MapperExtension): def populate_instance(self, mapper, selectioncontext, row, instance, identitykey, isnew): print Hello World # do some work here return EXT_PASS

[sqlalchemy] Re: about cascade rule

2007-02-01 Thread Dennis
On Feb 1, 5:24 am, Manlio Perillo [EMAIL PROTECTED] wrote: Hi. I still do not fully understand cascade rules, however I want to be sure the behaviour below is a feature and not a bug. Did you intend for the B object to be able to not exist? I modified your code to create a b object as

[sqlalchemy] Re: MapperExtension with options

2007-02-01 Thread Michael Bayer
ah the mapper isnt taking into account the extensions that are local to the query during the _instance() phase. we can add a ticket for that. On Feb 1, 12:08 pm, Dennis [EMAIL PROTECTED] wrote: I wanted to experiment with using a MapperExtension to add a couple of non-mapped properties to a

[sqlalchemy] Re: about cascade rule

2007-02-01 Thread Michael Bayer
delete-orphan on the A relationship means, no A is allowed to exist in the database without a parent B. the rule used to be more lax and would only fire off when an A was removed from a B...but that missed a lot of cases. the specificness of the error message indicates its definitely not a bug

[sqlalchemy] Re: Tool to check whether DB matches model

2007-02-01 Thread Michael Bayer
well, just making an app in such a way that all the model classes are attached to a single-datamember called model is just one of an infinite number of ways to do MVC. so your app is sort of part of a larger framework (whether that framework explcitly exists or not). On Feb 1, 2007, at

[sqlalchemy] how do I set an engine to autocommit?

2007-02-01 Thread Kumar McMillan
I have a program that is entering a deadlock (pyscopg) after an exception since the test suite tries to delete stuff as part of cleanup. I tried wrapping everything in a transaction to be sure a rollback is called but it *appears* that when I start using transaction.session.bind_to.execute(stmt)

[sqlalchemy] Re: about cascade rule

2007-02-01 Thread Manlio Perillo
Michael Bayer ha scritto: delete-orphan on the A relationship means, no A is allowed to exist in the database without a parent B. the rule used to be more lax and would only fire off when an A was removed from a B...but that missed a lot of cases. the specificness of the error message

[sqlalchemy] Re: MapperExtension with options

2007-02-01 Thread Dennis
On Feb 1, 12:58 pm, Michael Bayer [EMAIL PROTECTED] wrote: ah the mapper isnt taking into account the extensions that are local to the query during the _instance() phase. we can add a ticket for that. http://www.sqlalchemy.org/trac/ticket/454

[sqlalchemy] Anyone using migrate?

2007-02-01 Thread Allen
I was considering the use of migrate (http://erosson.com/migrate/) for a new project using SA and I just wondered if anyone else is using it? Are there any plans to integrate this support into a future version of SA? Thanks, Allen --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: how do I set an engine to autocommit?

2007-02-01 Thread Michael Bayer
On Feb 1, 3:02 pm, Kumar McMillan [EMAIL PROTECTED] wrote: I have a program that is entering a deadlock (pyscopg) after an exception since the test suite tries to delete stuff as part of cleanup. I tried wrapping everything in a transaction to be sure a rollback is called but it *appears*

[sqlalchemy] Re: SQLAlchemy + MySQL encoding error (probably wrong charset=... handling)

2007-02-01 Thread Michael Bayer
dont use the Unicode type if your MySQL client and/or server is converting unicode for you. convert_unicode=False has no effect on the Unicode type. also note theres a bug in MySQLDB related to this: http://sourceforge.net/tracker/index.php?func=detailaid=1592353group_id=22307atid=374932

[sqlalchemy] Re: how do I set an engine to autocommit?

2007-02-01 Thread Kumar McMillan
...but it *appears* that when I start using transaction.session.bind_to.execute(stmt) directly, it is not part of the transaction. uh yeah...why would it be ? youre essentially pulling out the original bind_to engine which has no idea about what particular connection/transaction is

[sqlalchemy] Re: how do I set an engine to autocommit?

2007-02-01 Thread Jonathan Ellis
On 2/1/07, Kumar McMillan [EMAIL PROTECTED] wrote: the fact that the deadlock was solved when I added the connection to the transaction tells me that psycopg runs in commit mode automatically (even though dbapi 2 says it should not). The psycopg docs reinforce this too :

[sqlalchemy] Re: Anyone using migrate?

2007-02-01 Thread Evan Rosson
I was considering the use of migrate (http://erosson.com/migrate/) for a new project using SA and I just wondered if anyone else is using it? I'm using it, but then, I wrote it. It's worked well for me, though I'm not sure how widely used it is... the mailing list is pretty quiet. Are there

[sqlalchemy] Re: how do I set an engine to autocommit?

2007-02-01 Thread Kumar McMillan
heh, I was saying it backwards [lack of sleep] but this is what I was referring to ... Note that if the database supports an auto-commit feature, this must be initially off. An interface method may be provided to turn it back on. - http://www.python.org/dev/peps/pep-0249/ ...yes psycopg

[sqlalchemy] Re: Anyone using migrate?

2007-02-01 Thread Allen Bierbaum
On 2/1/07, Evan Rosson [EMAIL PROTECTED] wrote: I was considering the use of migrate (http://erosson.com/migrate/) for a new project using SA and I just wondered if anyone else is using it? I'm using it, but then, I wrote it. It's worked well for me, though I'm not sure how widely used

[sqlalchemy] Re: Full Text Search using PostgreSQL and tsearch2

2007-02-01 Thread Sanjay
Thanks a lot, guys. Will try a sample application and post in the wiki. Might take some time - meanwhile, if somebody gets some more stuff, posting it would help. thankssanjay Really sorry - I could not touch this yet. Have got suddenly busy in preparing for some training, which suddenly

[sqlalchemy] Re: SQLAlchemy + MySQL encoding error (probably wrong charset=... handling)

2007-02-01 Thread Andrew Stromnov
cities = cities.select(limit=1).execute().fetchall() works well with this configuration, but leads to error in nregion = places.select(places.c.name == iv2).execute() if nregion = places.select(places.c.name == iv2).execute() used first, then string conversion error appear at cities =