this is ticket 2188:
http://www.sqlalchemy.org/trac/ticket/2188
The issue involves excessive digging into the column expressions of the order
by, when it attempts to place those columns into the nested query. This step
is necessary for many tests where the columns need to be SELECTed on the in
sorry, either:
results = session.query(Book).options(
orm.undefer(Book.num_purchased),
orm.contains_eager('purchases')
).order_by("calculated_books_num_purchased").\
limit(50).from_
you can do it manually as the combination of automatic joins and ordering by
subqueries seems to get tripped up (its a bug, but not sure of the nature of it)
results = session.query(Book).options(
orm.undefer(Book.num_purchased),
or
Not sure how you get 2 queries, but this seems like it gives right answer.
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
items = relationship('Item')
class Item(Base):
__tablename__ = 'items'
id = Column(Integer, pr
I ran into a problem with a rather unique query on SA 0.6.5
(reproducible on 0.7.1). The query eagerloads a collection, undefers a
scalar-select column, orders on the latter, and applies a limit/
offset. To order by a scalar-select column without executing the
subquery again, I have to apply a cust
I have a select with a count on it. Count row is taken from another
related table so I can see how many items a user has. I want to filter
the results to select only those with items more than 5 let's say.
Sqlalchemy generates 2 queries for this. Placing a 'having' filter
gives an error but lookin
On Jun 7, 2011, at 1:23 PM, Sebastian Elsner wrote:
> Hello,
>
> using Python 2.6 and SA 0.6.6. Please see the example below. I want to get
> the History of a relationship attribute, but whatever I pass to the "passive"
> argument, I never get the "deleted version" of the object, only the
> P
Hello,
using Python 2.6 and SA 0.6.6. Please see the example below. I want to
get the History of a relationship attribute, but whatever I pass to the
"passive" argument, I never get the "deleted version" of the object,
only the PASSIVE_NO_RESULT symbol (if I understand correctly, I would
not
On Jun 7, 2011, at 8:57 AM, Filip Zyzniewski - Tefnet wrote:
> # this line:
> print BillGates.subordinates.count()
> # raises:
> # Traceback (most recent call last):
> # File "count_problem.py", line 60, in
> # print BillGates.subordinates.count()
> # File
> "/home/filip/tefnet/teferp/w
On Jun 7, 2011, at 6:03 AM, Felix Wolfsteller wrote:
> Hi,
>
> I try to insert a big number of of rows to a table and want to receive the
> ids
> that were assigned to these (new) rows.
> If i insert a single row, it works as expected, but with multiple rows I run
> into an error:
> Attribute
On Jun 7, 2011, at 7:17 AM, Vlad K. wrote:
>
> Hi all!
>
>
> I have a daily stats table with the date as primary key. Currently the date
> is string in the MMDD format, but I'll probably port it to a Date type
> for easier statistical analysis. Other cols are various counters that get
>
not that I'm aware of but its something I consider often.
the closest right now is if the SP is callable as in func.foo(), you can map to
func.foo().
http://www.sqlalchemy.org/trac/wiki/07Migration#Non-Table-derivedconstructscanbemapped
but this considers the function to be like a "view", which
Hi all!
I have a daily stats table with the date as primary key. Currently the
date is string in the MMDD format, but I'll probably port it to a
Date type for easier statistical analysis. Other cols are various
counters that get incremented in various situations.
My problem is that I n
Here's the code I've come up with:
class GeometryDDL(object):
try:
from sqlalchemy import event
except ImportError:
# SQLAlchemy 0.6
use_event = False
columns_attribute = '_columns'
else:
# SQLALchemy 0.7
use_event = True
columns_
Hi everybody,
After switching from SQLAlchemy 0.6.5 to 0.7.0 we have observed a
problem with such an example code:
(copy at http://ideone.com/WB36Y)
==
# Fails with Python-2.7.1 and SQLAlchemy-0.7.0
#
import sqlalchemy
import sqlalchem
Hi,
I try to insert a big number of of rows to a table and want to receive the ids
that were assigned to these (new) rows.
If i insert a single row, it works as expected, but with multiple rows I run
into an error:
AttributeError: 'DefaultExecutionContext' object has no
attribute '_inserted_pri
Hi All,
Are there any example knocking about of mapping the results of a MySQL
stored procedure to an object?
cheers,
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
--
You received this message because you are subscrib
On Jun 7, 12:42 am, Michael Bayer wrote:
>
> Below is a short test, can you figure out what you might be doing differently
> ?
[snip]
Michael, thanks very much. The database I'm looking at is my test
database for the application I'm developing and it gets used and
abused quite often and it's en
18 matches
Mail list logo