Michael Bayer wrote:
I've implemented all the missing class-level methods on
ScopedSession in r3212, so you should be able to call refresh().
Great, thanks. I'll check this out.
But also, if you want to say Session(), then work with it, that is
also the intended usage model, although
Alexandre CONRAD wrote:
Don't forget to answer my question: What are the benefits of
instantiating a Session object ?. Actually, I just feel better working
*with* a instantiated object.
Hey, I just set my code to instantiate the session, and I get the
following error when I delete a
Hi,
A little update; this code handles the case where columns have a key
attribute:
model = __import__(sys.argv[1])
if sys.argv[2] == 'copy':
seng = create_engine(sys.argv[3])
deng = create_engine(sys.argv[4])
for tbl in model.metadata.table_iterator():
print tbl
Hi,
I have query which works which joins two tables together (Am using
elixir and tesla trunks, SA 0.3.10):
q = model.Thing.query()
q = q.add_entity(model.OtherThing)
q = q.filter(my_filter_expr)
q.all()
This executes fine.
but doing: q.count() (Am trying to use webhelpers.paginate) ,
class
I notice there is no support for the NULLS FIRST/NULLS LAST specifier
on ORDER BY clauses.
Am I overlooking something or is this really the case?
Is there any chance of support for this coming soon? Or is it too
vendor-specific to be in SQLAlchemy?
If it is feasible, has anyone created a
This is my error.
I'm creating a custom Column object (via subclassing), because I want
to override operator behaviour for .in_
to provide geometry support to a column. I must of missed something
in implementing the column subclass.
Currently, I'm just returning a string from the in_( method of
On Aug 9, 2007, at 3:59 AM, Alexandre CONRAD wrote:
But also, if you want to say Session(), then work with it, that is
also the intended usage model, although the Session.xxx methods
should in theory be all you need.
Why should I instantiate session = Session() if everything off the
On Aug 9, 2007, at 4:12 AM, Alexandre CONRAD wrote:
Alexandre CONRAD wrote:
Don't forget to answer my question: What are the benefits of
instantiating a Session object ?. Actually, I just feel better
working
*with* a instantiated object.
Hey, I just set my code to instantiate the
i was totally guessing mysql on this one...but its oracle ! who knew.
you're free to just use a string and say order_by=somecolumn NULLS
FIRST on this. we could add an operator to the oracle module if
that helps, something like (assume 0.4 usage)
Hi, related to my recent post on subclassing Column:
The problem I have is that the right tables are not appearing in the
FROM list in the query.
I have overriden the 'in_' operatror on the column.
When calling 'all()' on my query instance, I get the result back as I
expected, but when calling
add_entity() by itself is not going to add a table to a count()
function; the extra entities arent taken into account by count().
Looking at the query you have below, i.e. the one which works, im a
little puzzled. you aren't associating the geo_route and
geo_location tables together
Michael Bayer wrote:
Hey, I just set my code to instantiate the session, and I get the
following error when I delete a client (which has a bunch of cascading
all, delete-orphan rules).
session = Session()
NB: I've mapped the session.delete function to my model object for
convenience:
SQLAlchemy mangles identifiers that have dollar signs in them; in
particular, the regular expression in ANSICompiler.after_compile()
that searches a statement for positional parameters will take a
parameter like
:foo$bar
and only snatch the foo out of it, instead of foo$bar. The error
that
Greetengs, i tried to solve the problem using different approaches but
none of them worked.
Here are the examples using both, plain SQL and SQLALchemy methods.
* Using plain SQL:
create table node(id integer, parent_id integer, type_id integer);
insert into node(1,NULL,1);
insert into node
Greetengs, i tried to solve the problem using different approaches but
none of them worked.
Here are the examples using both, plain SQL and SQLALchemy methods.
* Using plain SQL:
create table node(id integer, parent_id integer, type_id integer);
insert into node(1,NULL,1);
insert into node
Hello,
Michael Bayer said the following on 09.08.2007 17:09:
we could add an operator to the oracle module if
that helps, something like (assume 0.4 usage)
order_by=oracle.nullsfirst(mycolumn.desc()) , i guess that is
important if youre applying ordering to relations which get
On Aug 9, 2007, at 11:43 AM, Alexandre CONRAD wrote:
So I prepared a test case in a single file, but it works in both
cases.
My problem is in my Pylons app, and I suspect that the dispersed
modules
doing imports are making some trouble (session instantiated in a
module,
then
thanks, i put this in ticket 719 so that someone can patch it.
On Aug 9, 2007, at 12:20 PM, Brandon Craig Rhodes wrote:
SQLAlchemy mangles identifiers that have dollar signs in them; in
particular, the regular expression in ANSICompiler.after_compile()
that searches a statement for
if youre on 0.3, you can explicitly correlate to n1 by saying:
myselect.correlate(n1)
also in 0.3, it would probably help to say scalar=True in your
select() statement (and you dont need the alias):
n1 = node_table.alias('n1')
sub_query = select([func.max(node_table.c.id).label('max_id')],
ah that changes things...if NULLS FIRST/LAST is part of ANSI sql then
id feel comfortable adding a core construct, like
order_by=column.nullsfirst().
On Aug 9, 2007, at 12:27 PM, Oleg Deribas wrote:
Hello,
Michael Bayer said the following on 09.08.2007 17:09:
we could add an operator
I'm using version 0.3.9 with PostgresSQL 8.1 .
Because postgres needs aliased subqueries i changed the example code
you sent to:
n1 = node_table.alias('n1')
sub_query = select([func.max(node_table.c.id).label('max_id')],
(node_table.c.type_id==n1.c.type_id), scalar=True)
sub_query.correlate(n1)
I cant manage to make sub_select appear at WHERE level, it always
appears at FROM level.
The SQL statement needs to select one node for each type, and each
node must be the one
with the max id in that type.
Is it possible to make this statement using SQLAlchemy ?
On Aug 9, 6:11 pm, Jeronimo
Hi,
I am writing a web application which retrieves data through SQLAlchemy.
Character-based data in this database is encoded as latin1.
My Web-framework (Zope3) expects strings in the unicode format and throws
errors like this:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in
Hello,
Michael Bayer said the following on 09.08.2007 20:50:
ah that changes things...if NULLS FIRST/LAST is part of ANSI sql then
id feel comfortable adding a core construct, like
order_by=column.nullsfirst().
Here is what I've found in SQL2003 draft:
In addition, NULLS FIRST or NULLS
OK just to double check, the syntax looks like:
SELECT * FROM sometable ORDER BY foo NULLS FIRST
SELECT * FROM sometable ORDER BY foo DESC NULLS LAST
? i.e. is DESC/ASC before the NULLS part ? or doesn't matter ?
we can add this to 0.4.
hiroshiykw wrote:
Hi.
In SQLAlchemy 0.3.10 ( / Python2.5), I found that YEAR column
type is created as TEXT column type in the following
[...]
Sorry about that. This is now fixed in the trunk for 0.4 and in
the 0.3 maintenance branch.
Cheers,
Jason
OK sorry, i didn't look carefully enough. when you use a scalar
subquery, you shouldn't access the c attribute on it. I hadn't
really realized that and maybe i should add an exception for that.
when you access the c attribute, you're treating it like another
relation to be selected from, so it
Hi Michael,
I've sorted this one now :)
I'm sorry for the amigious nature of my post... wasn't clear in my
head at the time.
You are right, I wasn't associating between the two entities in the
example I gave.
I ended up using sqlalchemy.sql._BinaryExpresssion in my subclass,
which enabled the
absolutely, see the docs on the create_engine() argument
convert_unicode here:
http://www.sqlalchemy.org/docs/03/dbengine.html#dbengine_options
and the docs on the Unicode datatype here:
http://www.sqlalchemy.org/docs/03/types.html
any string type also accepts a flag convert_unicode=True. so
hey matt -
you might also look at a new feature we have in 0.4 called composite
column types, this is an ORM-only feature whereby you can provide
column-behavior on a plugin basis and also use multiple columns to
represent a single scalar unit:
hey gang -
the last big page of the docs that i wanted to get out for 0.4 is
*mostly* complete, i just need to write about the ever-controversial
scoped_session() function and a little more about partitioning.
the doc is a lot more friendly than the previous doc and has shed most
of the
Hi Mike,
thank you so much for such an extensive answer. It has provided me
with much better insight about the topic, so that I can now make a
qualified decision on how to proceed.
Best regards,
Boris
On Aug 6, 8:39 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Aug 6, 2007, at 10:42 PM, Boris
32 matches
Mail list logo