[sqlalchemy] Re: Using assoc proxy with a regular field, help?

2007-02-06 Thread Roger Demetrescu
Hi iain On 2/5/07, iain duncan [EMAIL PROTECTED] wrote: Below is my code in case someone has time to look at it. At the moment it works to get article.ordering as a list instead of one field. Is there a way to tell it that this is only supposed to be one item? uselist is your friend.. :)

[sqlalchemy] Re: new setuptools vs local SA copy

2007-02-06 Thread King Simon-NFHD78
Rick Morrison wrote: I keep two versions of SA installed here, one is a stable version installed in the Python site-packages folder, and one is current trunk with some local patches for testing. I used to be able to run tests and programs using the local version by just inserting the

[sqlalchemy] Re: SelectResults, counts and one-to-many relationships

2007-02-06 Thread King Simon-NFHD78
Michael Bayer wrote: I added distinct() to selectresults as a method and made the unit test a little clearer (since i dont like relying on the selectresults mod)... q = sess.query(Department) d = SelectResults(q) d =

[sqlalchemy] inconsistent results between 2 testuites executions (SA 0.3.4)

2007-02-06 Thread sagblmi
When I run the testsuite more than once, results are differents. This strange behavior disappear when the the testsuite is launched with python in optimize mode 'python -OO alltest.py' This is particularly true with orm.inheritance5. Very very strange and very blocking since we can't guarantee

[sqlalchemy] just how lazy are backrefs?

2007-02-06 Thread Marco Mariani
I'm working inside TurboGears, autoload everything. Tested with 0.3.3 and Trunk. I find this strange behaviour: when I declare a relation between a Person and a Contract: assign_mapper(context, Contract, tbl['contracts'], properties = { 'responsible' : relation(Person,

[sqlalchemy] Re: just how lazy are backrefs?

2007-02-06 Thread Marco Mariani
Marco Mariani wrote: john.contracts_responsible gives me AttributeError: 'Person' object has no attribute 'contracts_responsabile' this is a cut-n-translate-n-paste typo, should read contracts_responsible of course --~--~-~--~~~---~--~~ You received

[sqlalchemy] py2exe sqlalchemy

2007-02-06 Thread Something Special
How to py2exe it? --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED]

[sqlalchemy] Re: got problems where map to selectable

2007-02-06 Thread Sébastien LELONG
If you put a refresh just before your assert, that is working: ... user = session.query(User).selectone_by(name='user1') session.refresh(user)# here ! assert user.post_count==2, 'user.post_count is %s'%user.post_count Not sure to understand why though... I bet its because of SA's cache

[sqlalchemy] Re: Inspect and __init__ of a mapped class

2007-02-06 Thread Michael Bayer
sureim not super thrilled with this whole issue since id rather __init__ is just left alone, but the whole auto-add-to-the-session behavior is pretty popular...so just submit a ticket/patch for whatever version you want there. On Feb 6, 7:29 am, Patrick Lewis [EMAIL PROTECTED] wrote: On Feb

[sqlalchemy] Re: py2exe sqlalchemy

2007-02-06 Thread Oleg Deribas
Hello, Something Special said the following on 06.02.2007 18:07: How to py2exe it? 1. Install SQLAlchemy with --always-unzip 2. Rename sqlalchemy's logging.py to log.py 3. Search/replace logging with log in all sqlalchemy's sources except log.py itself -- Oleg

[sqlalchemy] Re: just how lazy are backrefs?

2007-02-06 Thread Michael Bayer
yeah im not sure if i can fix that behavior, your call to Person.c.uid is compiling the Person mapper before the Contract mapper has been created. therefore when you call Person.get(), no mappers compile and Contract remains uncompiled, and your contracts_responsible attribute remains

[sqlalchemy] Re: inconsistent results between 2 testuites executions (SA 0.3.4)

2007-02-06 Thread svilen
i mentioned this dictionary-order on my ramblings some weeks ago; then u didnt take it into account. i've managed here to get repeatable testing and SQL generation with hack-replacing many {} with ordered ones, but i don't like the solution. Why not just use util.Dict (defaulting to dict)

[sqlalchemy] Updating a column to an expression containing itself; Inserting data by lists or tuples

2007-02-06 Thread S.R. Larmes
Hi, I'm trying to get into SQLAlchemy and it has been really great so far, but there are two things I can't figure out how to do: (both are outside of ORM) a) How do I do: UPDATE sometable SET value = value * 0.9 + 1[ + optional WHERE clause ] ? I've tried experimenting with

[sqlalchemy] Re: new setuptools vs local SA copy

2007-02-06 Thread Michael Bayer
as I have like 12 different SA directories which id like to jump between without going through a distinct install for each one, im a big fan of PYTHONPATH, and after futile-ly arguing with PJE that plain libraries on PYTHONPATH should take precedence over installed .eggs (he strongly feels that

[sqlalchemy] Re: inconsistent results between 2 testuites executions (SA 0.3.4)

2007-02-06 Thread Michael Bayer
On Feb 6, 1:13 pm, svilen [EMAIL PROTECTED] wrote: i mentioned this dictionary-order on my ramblings some weeks ago; then u didnt take it into account. because i stop reading rambles after 50-60 words or so, and the stress of glossing over the rest generally causes me to forget words 30-60 as

[sqlalchemy] Re: Using assoc proxy with a regular field, help?

2007-02-06 Thread iain duncan
On Tue, 2007-06-02 at 06:25 -0200, Roger Demetrescu wrote: Hi iain On 2/5/07, iain duncan [EMAIL PROTECTED] wrote: Below is my code in case someone has time to look at it. At the moment it works to get article.ordering as a list instead of one field. Is there a way to tell it that

[sqlalchemy] Re: Updating a column to an expression containing itself; Inserting data by lists or tuples

2007-02-06 Thread S.R. Larmes
Michael Bayer wrote: On Feb 6, 1:20 pm, S.R. Larmes [EMAIL PROTECTED] wrote: a) How do I do: UPDATE sometable SET value = value * 0.9 + 1[ + optional WHERE clause ] ? I've tried experimenting with .update(values=..) or stuff like .execute(value=sometable.c.value*0.9+1) but it

[sqlalchemy] Re: Updating a column to an expression containing itself; Inserting data by lists or tuples

2007-02-06 Thread Rick Morrison
Well one good thing about the positional-style INSERT is that it just might be useful for implementing INSERT INTO SELECT FROM, which would be a pretty useful addition to the SQL API layer On 2/6/07, S.R. Larmes [EMAIL PROTECTED] wrote: Michael Bayer wrote: On Feb 6, 1:20 pm, S.R.

[sqlalchemy] Re: Updating a column to an expression containing itself; Inserting data by lists or tuples

2007-02-06 Thread Michael Bayer
its all good, just not a high priority for me :). feel free to dig in. the insert/update code is already a little intense due to it already having multiple ways to do the same thing, not to mention its some of the first code i wrote in SA and feels a little old, so adding features like these