it be difficult to make
something like
session.query(B).join(ref, backward=True)
work?
Best regards,
Klaus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy
Let's assume there is a foreign key A.fk - B.id from table A to table
B, and these tables and columns are mapped to corresponding classes.
Then let's translate the foreign key to a reference A.ref - B via a
relation.
We can easily join B onto A: session.query(A).join(ref) or
OMG, I didn't read the second sentence on the page. Sorry for that.
Klaus
On 19 Mai, 19:21, Michael Bayer mike...@zzzcomputing.com wrote:
log in as guest/guest
On May 19, 2009, at 11:52 AM, klaus wrote:
How do I get the privileges for that?
On 19 Mai, 17:33, Michael Bayer mike
has no attribute '_sa_instance_state'
Cheers
Klaus
--~--~-~--~~~---~--~~
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
How do I get the privileges for that?
On 19 Mai, 17:33, Michael Bayer mike...@zzzcomputing.com wrote:
it seems like a small bug and you can file a ticket for that, but the
intent is that you'd be using None to represent NULL in the general
case.
On May 19, 2009, at 11:21 AM, klaus
Klaus
--~--~-~--~~~---~--~~
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
sqlalchemy+unsubscr
This seems to become an FAQ. ;-)
Klaus
On 9 Mrz., 11:34, Thomas Wittek [EMAIL PROTECTED] wrote:
On Mar 8, 5:49 pm, Michael Bayer [EMAIL PROTECTED] wrote:
__len__() is called first before
__iter__() and has the effect of two SQL statements being issued.
Actually it seems to be the other
. Calls to __cleanup show up in all unusual places (when the
garbage collector is activated) and take up considerable time.
Best regards
Klaus
On 7 Feb., 16:00, Michael Bayer [EMAIL PROTECTED] wrote:
On Feb 7, 2008, at 8:14 AM, klaus wrote:
State tracking, the method __cleanup
prevent changes from being committed to the database. This
solution is not very elegant, however.
Best regards
Klaus
On 22 Dez. 2007, 17:03, Michael Bayer [EMAIL PROTECTED]
wrote:
On Dec 22, 2007, at 12:34 AM, Andreas Jung wrote:
--On 21. Dezember 2007 16:33:34 -0500 Michael Bayer [EMAIL
(...,
dont_load=True) is also part of the mix. If it's a bug, I'll try to
provide more details.
Best regards
Klaus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email
Nice, thanks!
On 14 Jan., 16:16, Michael Bayer [EMAIL PROTECTED] wrote:
On Jan 14, 2008, at 5:30 AM, klaus wrote:
Hi all,
sometime since version 0.4.2, the after_update hook of a
MapperExtension fires even if no SQL UPDATE statement is generated. Is
this a bug or a feature
Fine with me. ;-)
Klaus
On Nov 23, 6:37 am, Michael Bayer [EMAIL PROTECTED] wrote:
Hi there -
there are actually two bugs here, the second one is revealed after
repairing the first.
The first bug is that the merge() dont_load operation was not
completing all the necessary housekeeping
Is it possible that your mapped class has a regular Python property
with the same name as a mapped relation?
Klaus
On 23 Nov., 17:08, lur ibargutxi [EMAIL PROTECTED] wrote:
Hi!
I made an aplication in my local machine but when I tried to do the same in
the server I had this problem
your time.
Klaus
On 7 Nov., 01:00, Michael Bayer [EMAIL PROTECTED] wrote:
I cant reproduce this one. I see you have named bind params so I
tried with postgres. it also works with sqlite. works with release
0.4.0 as well as the trunk.output is (with echoing):
SELECT testView.id
By the way, on a larger database, drop_all() runs into an endless
loop. However, I have no small script to reproduce this yet.
Klaus
On 7 Nov., 16:39, klaus [EMAIL PROTECTED] wrote:
That's very kind.
I'm on the trunk (0.4.1dev_r3747) and on linux. And I think your
script (with a changed
is that Python (2.5.1 versus the installed 2.4.1)
plus the latest psycopg2 does not make a difference.
Best regards
Klaus
On 7 Nov., 16:24, Michael Bayer [EMAIL PROTECTED] wrote:
On Nov 7, 2007, at 6:01 AM, klaus wrote:
This is strange. I had problems reproducing the bug for a long time
Hi all,
when I try to build up a complicated query like this:
query = session.query(Class)
query = query.filter_by(...).add_entity(...).join(...)
count = query.count()
query = query.add_entity(...).join(...).order_by(...)
print query.all()
the last statement fails due to a broken SELECT. The
,
binary_alias.fk2) AS squared JOIN unary ON nullary.id = unary.fk
\nWHERE %(param_1)s = squared.fk2 AND %(param_1_1)s = squared.fk1
ORDER BY squared.n' {'param_1_1': 1, 'param_1': 1}
Best regards
Klaus
On 6 Nov., 15:40, klaus [EMAIL PROTECTED] wrote:
Hi all,
when I try to build up a complicated query
,
'test_id_4': 8, 'test_id_5': 10, 'test_id_6': 11, 'test_id_7': 13}
Best regards
Klaus
--~--~-~--~~~---~--~~
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
On 2 Nov., 19:09, Michael Bayer [EMAIL PROTECTED] wrote:
On Nov 2, 2007, at 1:15 PM, klaus wrote:
Thanks, but this doesn't seem to do what I wanted. The merge modifies
the object and therefore tries to update the underlying table on
session.flush(). So it might work if you prevented
.)
I would prefer a solution, though, that allowed these objects to be
immutable like their tables. That is, copy.copy could be used but no
constructor and no setattr/delattr (and no remove). My implementation
currently catches these with a NotImplementedError.
Best regards
Klaus
On 31 Okt., 18
.
Is there a hidden connection between different sessions? I hope you
can make sense of these vague description.
Best regards
Klaus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group
Seems like I am learning more python on this list than I ever
wanted...
On 22 Okt., 15:37, Michael Bayer [EMAIL PROTECTED] wrote:
On Oct 22, 2007, at 6:32 AM, klaus wrote:
Hi all,
I wonder why some classes/objects implement part of a list interface -
but without a __len__ method
. __len__ could be used to
indicate when the session gets too large and should be cleared.
I already suggested this some months ago but attracted no
attention. ;-)
Best regards
Klaus
--~--~-~--~~~---~--~~
You received this message because you are subscribed
Thanks a lot! The solution is so simple that I feel a little
embarassed...
On 16 Okt., 18:15, Michael Bayer [EMAIL PROTECTED] wrote:
On Oct 16, 2007, at 10:45 AM, klaus wrote:
The only thing that I could find out about the reason is that in
engine/base.py (1290
test.id = %(test_id_1)s ORDER BY test.id
{'test_id_1': None, 'test_id': 2}
The first nested SELECT is wrong: test_id should be 1 and test_id_1
should be 2. The same holds for the third SELECT that tries to follow
the foreign key.
Therefore, the program prints
None
2 None
Best regards
Klaus
The following used to work in SQLAlchemy 0.3:
from sqlalchemy import *
from sqlalchemy.orm import *
metadata = MetaData(...)
metadata.bind.echo=True
table = Table(test, metadata,
Column(id, Integer, primary_key=True),
Column(active, Boolean))
table.create()
Maybe I should add that this bug appears under PostgreSQL and persists
in version 0.4.
On 16 Okt., 15:50, klaus [EMAIL PROTECTED] wrote:
SQLAlchemy generates wrong SELECTs for classes that are mapped to
select expressions. Consider the following example:
from sqlalchemy import *
metadata
:
On Jul 8, 2007, at 11:38 AM, klaus wrote:
(Finally continuing this old thread.)
The suggested fix does not seem to work. Here is an example:
1. To build the tables, create a schema test and run the following
code:
cant reproduce. using trunk, with or without the patch, this script
I'm not sure whether I understody your posting correctly. Now I've
checked out revision 2867 and nothing has changed, that is, I still
get the same exceptions.
Best regards
Klaus
On Jul 9, 9:44 am, klaus [EMAIL PROTECTED] wrote:
Oops, obviously I made a mess of my program when pasting
And when I am at it (this is going off topic): What do you think about
len(query) in addition to or instead of query.count()? IMO, count() is
nearly as SQLish als select().
Best regards
Klaus
On Jul 6, 3:20 pm, klaus [EMAIL PROTECTED] wrote:
I noticed that Session has no method len
have __len__ too.)
Best regards
Klaus
--~--~-~--~~~---~--~~
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
into
private attributes (with a leading underscore).
BTW, the mapper might want to check that keys are nonempty strings and
no two columns are mapped to the same attribute (currently, the last
one wins).
Best regards
Klaus
On 2 Jul., 18:12, Michael Bayer [EMAIL PROTECTED] wrote:
On Jul 2, 2007
there be three columns? And
where is the prefix s?
Best regards
Klaus
--~--~-~--~~~---~--~~
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 looks like a good solution. I'll need some time to provide a test
case, however.
If the change breaks existing code, how are cross-schema references
supposed to be handled?
Best regards
Klaus
On 18 Jun., 21:54, Michael Bayer [EMAIL PROTECTED] wrote:
On Jun 18, 2007, at 4:25 AM, [EMAIL
,
Klaus
--~--~-~--~~~---~--~~
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]
For more options
.
Any ideas? I'm afraid that this is connected with the VIEWs on the
sqlalchemy todo list.
Best regards,
Klaus
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send
37 matches
Mail list logo