what u want to accomplish?
looks like u need one of the .any(..) or .has(..), check those also.
or do u need a plain join?
On Wednesday 21 May 2008 07:50, andrew cooke wrote:
Hi,
Just wanted to check: I am seeing a NotImplementedError (v 0.4.6 on
Linux w Python 2.5) when I try to query some
jason kirtland schrieb:
robert rottermann wrote:
thanks jason,
jason kirtland schrieb:
robert rottermann wrote:
Hi there,
I am building a zope/plone site that uses sqlalchemy (collective.lead).
on two systems I am developping on everything works fine, a third one that
On May 21, 2:04 am, [EMAIL PROTECTED] wrote:
what u want to accomplish?
Well, it's the equivalent of the SQL IN.
So i want to retrieve all Measurements which are associated with with
a Time Series in the given list. The SQL equivalent would be
something like:
SELECT * from Measurement as M
On May 21, 2008, at 12:50 AM, andrew cooke wrote:
Hi,
Just wanted to check: I am seeing a NotImplementedError (v 0.4.6 on
Linux w Python 2.5) when I try to query some objects with the filter
in. Does that mean that the feature is not implemented, or is it
more likely an error in my
Michael Bayer wrote:
On May 20, 2008, at 12:15 PM, Gregor Kling wrote:
its not going to work if you create the mapper() (and Table) per
class
instance (i.e. within __init__),
It was a typo. It should be all SrvDomainTable.
But why shouldn't it work, I already do the test and it does.
Could
Gregor Kling wrote:
Michael Bayer wrote:
On May 20, 2008, at 12:15 PM, Gregor Kling wrote:
its not going to work if you create the mapper() (and Table) per class
instance (i.e. within __init__),
It was a typo. It should be all SrvDomainTable.
But why shouldn't it work, I already do the
On May 21, 9:37 am, Michael Bayer [EMAIL PROTECTED] wrote:
in_ is supported for column-based attributes. If you are getting
NotImplemented, that's beacuse time_series is referencing either a
collection or a many-to-one object reference. so SQL IN wouldn't
work here.For the many-to-one
Hey list -
I'm pretty antsy to start putting out alpha releases of 0.5. One of
the only things left to do for alpha-level is to decide on losing
Python 2.3 support, which all of us are pretty much ready to do.
We've mentioned it before and have not had any pleas for a stay of
This is probably very simple, but I am searching the docs and not
finding the answer :-(
In 0.3 I had a working statement of the form:
engine.execute(table.select(), cond_dict)
where cond_dict is a dictionary of column names mapped to values.
In 0.4.6 this does not work. What is produced in SQL
Hi,
I thought the original impetus for scope_identity was not multiple execution
contexts, but rather things being fouled up for some users where they had
nested INSERTs being done via a trigger on the mapped table, and the
brain-dead SELECT @@identity_insert wasn't able to pluck out the
On May 21, 2008, at 11:06 AM, Moshe C. wrote:
This is probably very simple, but I am searching the docs and not
finding the answer :-(
In 0.3 I had a working statement of the form:
engine.execute(table.select(), cond_dict)
where cond_dict is a dictionary of column names mapped to values.
I'm developing a Django site that uses a lot of pre-existing
SQLAlchemy tables to generate reports, etc. I'm trying to get my head
around the best way to programmatically generate some fairly complex
queries.
For instance, our users may have several roles assigned to them, and
the data
Thanks.
So I guess you cannot use the dictionary argument as is. It was very
convenient.
On May 21, 6:16 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On May 21, 2008, at 11:06 AM, Moshe C. wrote:
This is probably very simple, but I am searching the docs and not
finding the answer :-(
In
On May 21, 2008, at 11:37 AM, Moshe C. wrote:
Thanks.
So I guess you cannot use the dictionary argument as is. It was very
convenient.
It greatly complicated statement compilation since the cond_dict
needed to be sent along to the compilation of table.select(), where
extra logic kicked
Hi,
is there any way to ask select object what is suppose to select? There
is a method locate_all_froms which return FROM part of select, but I'm
interesting in select part of SQL statement.
So, something like:
s = select([table1.c.a,table2.c.b])
listOfSelectedColumns =
Hi. If I have a many-to-many relation between Class1 and Class2, the
following query:
Class1.query.filter(Class1.class2s.contains(obj1)).filter(Class1.class2s.contains(obj2))
, where obj1 and obj2 are instances of Class2, generates the following
sql in .4.6:
SELECT lots of columns
FROM class1,
I've posted the following question on the Elixir group and they sent
me here.
My setup
##
# Tables
##
roles = Table('roles', meta,
Column('id', Integer, primary_key=True),
Column('name', String(25))
)
users = Table('users', meta,
Column('id', Integer, primary_key=True),
calling inner_columns() on the select() returns what actually gets
rendered. The exported columns, i.e. those which you'd use when
using the select() as a subquery, are accessible via the .c. attribute
on the select() which has a dictionary interface.
On May 21, 2008, at 12:01 PM,
this might be a bug introduced in 0.4.6, it would be helpful if you
could post a full test case as a trac ticket. Though im not sure how
this would have worked in 0.4.5 either since I don't think we have any
coverage for this exact scenario and there wasn't any aliasing logic
removed
you need to set cascade='all, delete-orphan' on the relation
referencing the AssociationProxy.Some docs on ORM cascades are in
the ORM tutorial as well as
http://www.sqlalchemy.org/docs/04/session.html#unitofwork_cascades
.
On May 21, 2008, at 12:14 PM, kremlan wrote:
I've
it doesn't seem to work for me, I just did two print statements
print type(query)
print query.inner_columns()
and got the following traceback
class 'sqlalchemy.sql.expression.Select'
Traceback (most recent call last):
print query.inner_columns()
TypeError: 'generator' object is not callable
sorry, its a property. call list(select.inner_columns)
On May 21, 2008, at 12:59 PM, vkuznet wrote:
it doesn't seem to work for me, I just did two print statements
print type(query)
print query.inner_columns()
and got the following traceback
class 'sqlalchemy.sql.expression.Select'
http://www.sqlalchemy.org/trac/ticket/1058
I found the query I had that worked with .4.5 and it is different
because it is using not_ on each contains() which generates separate
subselects (with Exists), so that doesn't have aliasing problems. That
still works in .4.6.
On Wed, May 21, 2008 at
On Tue, 20 May 2008 18:10:31 -0700 (PDT)
Marcus Cavanaugh [EMAIL PROTECTED] wrote:
I've read the ShardedSession docs a few times. The shard_chooser()
callable is straightforward, and thanks to the example [1], I think I
understand how to use query_chooser(); but I need a pointer about how
to
i have asked about similar thing (e.g. some filter_or construct) and there's
nothing so far that can do ORs or UNIONs - or any other query arithmetics
except AND. See that thread (last week), there were some workarounding
suggestions, using left outer join or so.
On Wednesday 21 May 2008
Hi,
I am migrating a project from SA 0.3 to SA 0.4 and the following field/
index produces an error:
sa.Table('resource_path', self.db_metadata,
sa.Column('id', sa.Integer, primary_key =
True),
sa.Column('path', sa.Binary(255), index = True),
I'm doing a query and would like to order the results in alphabetical
order. However, the column used is mixed case, so the results have
all lower-case strings before the upper-case variables.
In SQL, I would fix this by using the lower() function such as:
TABLE data (
strName TEXT() NOT NULL
On May 21, 2008, at 5:06 PM, EricHolmberg wrote:
I'm doing a query and would like to order the results in alphabetical
order. However, the column used is mixed case, so the results have
all lower-case strings before the upper-case variables.
In SQL, I would fix this by using the lower()
# How do I apply the lower(field) function to the strName column?
rows = model.data.query().order_by(strName).all(
query.order_by(func.lower(strName))
Thanks Michael - you're a life saver! Somehow, I seemed to have
missed the entire section on sqlalchemy.sql.func.
For anybody else in the
I'm running this query: q = Event.query.filter(and_(Event.id
id_under, Event.feed == True,
Event.ns_id.in_(ns_list))).limit(num).order_by([Event.updated.desc(),
Event.id.desc()])
For some reason, sqlalchemy decides to pull the entire table, yet,
when I don't include Event.id id_under, it
The and_ function is expecting two arguments, not a series of *args. It
works when you remove the third argument because you then have the expected
two arguments.
Either use nested calls to and_, or multiple calls to filter(), and build
up the query in a generative fashion, like this:
You're right, that was the original motivation. I tried just changing
@@identity for scope_identity(), which worked just fine on pymssql, but not
on the other adapters. Did eventually get it working, but it involved pyodbc
changes, that I was unable to do. Fortunately someone on the list
hmm, I switched from 3 args to 2 and am still having the same issue.
On May 21, 5:13 pm, Rick Morrison [EMAIL PROTECTED] wrote:
The and_ function is expecting two arguments, not a series of *args. It
works when you remove the third argument because you then have the expected
two arguments.
33 matches
Mail list logo