-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Stephen Hansen
Sent: 25 August 2009 07:34
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Tracking Last Update timestamp for models
Hi all.
I'm working on converting
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Michele Simionato
Sent: 26 August 2009 13:40
To: sqlalchemy
Subject: [sqlalchemy] from a sqlalchemy table to the
corresponding CREATE TABLE sql code
A part from setting
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of gizli
Sent: 02 September 2009 04:45
To: sqlalchemy
Subject: [sqlalchemy] Curious Problem
Hi all,
I just discovered something weird when doing concurrency testing with
my
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Eloff
Sent: 08 September 2009 04:40
To: sqlalchemy
Subject: [sqlalchemy] How to bypass scoped_session?
Hi,
I'm using scoped_session in my pylons app, but sometimes I have
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Eloff
Sent: 08 September 2009 21:34
To: sqlalchemy
Subject: [sqlalchemy] Re: How to bypass scoped_session?
On Sep 8, 3:47 am, King Simon-NFHD78 simon.k...@motorola.com
wrote
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of C.T. Matsumoto
Sent: 15 September 2009 07:21
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: getting data from primary keys
That did the trick.
Thanks a lot.
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Randall Nortman
Sent: 22 September 2009 16:31
To: sqlalchemy
Subject: [sqlalchemy] Pre-commit validation spanning multiple
tables/ORM classes
[SNIP]
So if I do this with
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Crusty
Sent: 23 September 2009 15:48
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] unexpected chained relations and
append behaviour
Hello everyone,
I have a
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Crusty
Sent: 24 September 2009 16:16
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: unexpected chained relations and
append behaviour
Hello Simon,
thanks for
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Christian Démolis
Sent: 01 October 2009 10:40
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Bypass checking to database structure
(metadata.create_all)
Hi again,
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of kkapron
Sent: 01 October 2009 21:27
To: sqlalchemy
Subject: [sqlalchemy] Select from multiple databases
Hello, I'm a beginner in sqlalchemy and I've got a problem with select
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Yannick Gingras
Sent: 09 October 2009 14:43
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Duck-typing style of relations
Greetings Alchemists,
this is more of a
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Luke Arno
Sent: 14 October 2009 16:41
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: ORM Many to Many Across Two Databases
It looks like if I put the relation on the
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Mike Conley
Sent: 15 October 2009 14:43
To: sqlalchemy@googlegroups.com
Cc: SQLElixir
Subject: [sqlalchemy] Re: bad result when querying for null
values (in pk at least)
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling
Sent: 15 October 2009 14:42
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Declerative Relation trouble
Hi All,
I am having a very bad day (or two
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling
Sent: 15 October 2009 15:38
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: Declerative Relation trouble
Hi Simon,
(I do things a little
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling
Sent: 15 October 2009 15:55
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: Declerative Relation trouble
I downgraded SQLA to version 0.5.5, no
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling
Sent: 15 October 2009 16:21
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re:[runs one one installation not on
the other] Declerative Relation trouble
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Martijn Moeling
Sent: 15 October 2009 16:27
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: [runs one one installation not on
the other] Declerative Relation trouble
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of rajasekhar911
Sent: 17 November 2009 11:32
To: sqlalchemy
Subject: [sqlalchemy] Re: column label and order by
anyone??
On Nov 14, 6:48 pm, rajasekhar911
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of werner
Sent: 25 January 2010 13:37
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] dynamic_loader
On 24/01/2010 16:57, werner wrote:
...
Next thing is to make
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Boda Cydo
Sent: 26 January 2010 01:35
To: sqlalchemy
Subject: [sqlalchemy] Re: Is it possible to narrow down the
generated query in SQLAlchemy if it was created via
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Chris Withers
Sent: 26 January 2010 09:13
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] any way to pre cook a monster query?
Hi All,
I have a few monster queries like
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Michael Bayer
Sent: 27 January 2010 16:31
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] Map to Arbitrary Select Using Raw SQL
Michael Chambliss wrote:
Hey Michael
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Manlio Perillo
Sent: 29 January 2010 13:15
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] problem when executing multiple insert
statements and boolean type
-BEGIN
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Adam Tauno Williams
Sent: 03 February 2010 12:17
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Getting useful error messages
Attempting, again, to get a declarative
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of werner
Sent: 04 February 2010 09:41
To: sqlalchemy@googlegroups.com
Subject: Re: [sqlalchemy] Using a arbitrary select
mapper/class in a relation - is this allowed?
On
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Mike Driscoll
Sent: 04 February 2010 03:34
To: sqlalchemy
Subject: [sqlalchemy] Another tutorial!
Hi,
I just finished up a tutorial series on SqlAlchemy that I thought I'd
Mike Driscoll wrote:
On Feb 4, 8:30 am, Mike Driscoll kyoso...@gmail.com wrote:
On Feb 4, 4:24 am, King Simon-NFHD78 simon.k...@motorola.com
wrote:
[SNIP]
Not a serious blunder, but I think there may be a small
mistake in part
2, where you describe updating an email address
Mike Driscoll wrote:
Thanks Simon! That made sense. I've fixed my example to match what you
said. Sorry about that.
- Mike
No problem. I'm afraid you still have a typo though. You have:
addresses[0].email_address = Address(pr...@marvel.com)
Whereas you want:
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Paul Rigor (uci)
Sent: 24 February 2010 00:23
To: sqlalchemy
Subject: [sqlalchemy] reflecting schema just on a single table
Hi,
Is there anyway to use a metadata object just
Christian Klinger wrote:
[SNIP]
Ok now a second table comes into the game. The name of this table is
BTeilnehmer. As you can see this table has a ForeignKey to
Unternehmen.mnr. I use a seperate metadata BaseC for it because i want
to create this table.
Hi,
I don't know if the seperate
Manlio Perillo wrote:
Hi.
Is it possible, in SQLAlchemy, to express this query?
CREATE TEMP TABLE foo (
x INTEGER,
y INTEGER
);
INSERT INTO foo VALUES (10, 11);
INSERT INTO foo VALUES (1, 2);
manlio= SELECT * FROM foo WHERE (x, y) in (VALUES (1, 2), (3, 4));
x | y
-
Daniel Robbins wrote:
Hi All,
One of the things that doesn't seem to be covered in the
docs, and that I'm currently trying to figure out, is the
recommended design pattern to use for managing sessions from
declarative methods calls.
Consider a declarative class User, where I want to
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Matthew Williams
Sent: 26 March 2010 12:10
To: sqlalchemy@googlegroups.com; twisted-pyt...@twistedmatrix.com
Subject: [sqlalchemy] Re: SQLAlchemy, Twisted, and sAsync
On Mar
It may not help in your situation, but did you know that you can also
index the row with the Column instances themselves
Ie: row[table.c.column]
Simon
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Yuri Pimenov
Sent: 27 November 2007
imgrey wrote:
Based on my observations it happens only with concurent inserts/
updates.
One thread :
{{{
f_table.insert().execute()
session.flush()
transaction = session.begin()
nested = session.begin_nested()
try:
f_table.insert().execute()
except IntegrityError:
#record is
Felix Schwarz wrote:
I have a question which I think is similar enough to be asked
in the same
thread: I have a set of quite simple migration scripts which
us SQLAlchemy 0.4
and Elixir 0.4. I do extract data from the old legacy (MySQL)
database with
SQLAlchemy and put this data into
It may not matter to you, but I wouldn't have thought this would be a
very efficient query, because the database is going to have to call the
DATE_FORMAT function twice for every row in your table. I would have
thought a more efficient version would be one that asks for all rows
between the first
Hi,
I used to be able to iterate over mapper.properties.items() to get the
name of each mapped property along with the object that implements it.
However, in 0.4.1, trying to do this results in a NotImplementedError
telling me to use iterate_properties and get_property instead, but I
can't see a
svilen wrote:
On Tuesday 11 December 2007 13:13:37 King Simon-NFHD78 wrote:
Hi,
I used to be able to iterate over mapper.properties.items() to get
the name of each mapped property along with the object that
implements it. However, in 0.4.1, trying to do this results
Hi,
I'm connecting to an ancient version of MySQL (3.23.58) that (as far as
I can tell) doesn't support basic JOIN table ON condition syntax
Ie. this gives a syntax error:
SELECT * FROM productversions pv
JOIN producttypes pt ON pv.producttype = pt.producttype
Whereas this is fine:
Felix Schwarz wrote:
Hi,
after reading the docs [1] I thought that something like
session.query(User).filter(User.c.id 3)[0]
should work even if the filter clause does not return any rows.
But - compliant with Python's behavior - SQLAlchemy raises an
IndexError.
(...)
File
Michael Bayer wrote:
On Dec 11, 2007, at 10:07 AM, King Simon-NFHD78 wrote:
I assume the problem is that my date_created column isn't
immediately
available at the 'after_insert' stage, because it is
generated in the
SQL INSERT statement, but hasn't been read back from
Michael Bayer wrote
On Dec 12, 2007, at 9:04 AM, King Simon-NFHD78 wrote:
Hi,
I'm connecting to an ancient version of MySQL (3.23.58)
that (as far
as
I can tell) doesn't support basic JOIN table ON
condition syntax
Ie. this gives a syntax error:
SELECT * FROM
Jason kirtland wrote:
King Simon-NFHD78 wrote:
Hi,
I'm connecting to an ancient version of MySQL (3.23.58)
that (as far as
I can tell) doesn't support basic JOIN table ON
condition syntax
Ie. this gives a syntax error:
SELECT * FROM productversions pv
JOIN
sqlalchemy_schemadisplay.py is not part of the SQLAlchemy distribution -
it's a separate script attached to that wiki page. You can download it
from the link at the bottom of the page.
Hope that helps,
Simon
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL
Would create_date = '2007-01-01' and create_date '2008-01-01' be
acceptable?
If so, something like this should work
from sqlalchemy import and_
from datetime import date
data = Table.query().filter(and_([Mikropost.c.create_date = date(2007,
1, 1),
If you're using easy_install to install them, you should be able to
install them with the '-m' (--multiversion) switch. See:
http://peak.telecommunity.com/DevCenter/EasyInstall#command-line-options
Choosing the version you want to use in your application is then done
like this:
import
Hi,
If your database is set up to generate auto-incrementing primary keys on
INSERT (such as a MySQL auto-incrementing column), then SA will retrieve
the new value when the object is flushed to the database. When the
object is constructed, the primary key will be None until you flush the
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of maxi
Sent: 08 February 2008 14:30
To: sqlalchemy
Subject: [sqlalchemy] Re: Search in object list by field value
Thanks Simon,
I was doing of that manner.
Now, is advisable implement
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of maxi
Sent: 08 February 2008 13:47
To: sqlalchemy
Subject: [sqlalchemy] Re: Search in object list by field value
On 8 feb, 09:58, svilen [EMAIL PROTECTED] wrote:
On Friday 08 February
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Chris Withers
Sent: 13 February 2008 13:51
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: schema changes
Michael Bayer wrote:
What if they exist but don't match the spec
Yannick Gingras wrote:
Greetings Alchemists,
Is it possible to define a hook in a mapped class that will
be called
to test the sanity of an instance before it gets committed?
As an example:
class Item(object):
def _pre_commit(self):
assert (self.dry_weight +
Lukasz Szybalski wrote:
I have mysqldb installed in the system wide install how do I tell
virtualenv to use it?
I don't see a need to install it in virtualenv again so I guess I just
have to givea right path? How, and in which file?
Thanks,
Lucas
File
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of lilo
Sent: 10 June 2008 17:23
To: sqlalchemy
Subject: [sqlalchemy] select db engine with create_session
can someone tell me how session chooses the right db engine to insert
records in
-Original Message-
From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of jack2318
Sent: 11 June 2008 17:50
To: sqlalchemy
Subject: [sqlalchemy] text
I tried very simple test:
s = text(SELECT COUNT(*) FROM table WHERE field LIKE 'something')
count =
Lilo wrote:
My understanding of this query_chooser is that it's used when you want
to execute orm's sql rather than raw sql.
I don't quite understand what is visit_binary function do from
attribute_shard.py example. What does it mean binary.operator,
binary.left, binary.right.clause and
Tai Tran wrote:
[snip]
class PC(object):
...
def destroySelf(self):
db_session = Session()
...
for port in self.ports:
port.destroySelf()
...
db_session.delete(self)
...
class Port(object):
...
Heston wrote:
[SNIP]
Above you talk about a global module in the application which
creates the
Base and metadata, but I don't understand how these can then
be accessed by
other classes around the application?
Do you have any good sample code or a link to a decent
tutorial? Seems
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Randy Syring
Sent: 30 September 2008 07:17
To: sqlalchemy
Subject: [sqlalchemy] Re: How to turn off UPDATE on child
objects when deleting parent object
On Sep 30, 2:14 am, Randy Syring
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of alex bodnaru
Sent: 15 October 2008 11:00
To: SQLAlchemy
Subject: [sqlalchemy] how to print a constructed query with
it's parameters?
hello friends,
in order to debug my code, i
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of John Hunter
Sent: 10 November 2008 14:07
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: select where field=max(field)
On Mon, Nov 10, 2008 at 4:33 AM, King Simon-NFHD78
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of joelanman
Sent: 10 November 2008 00:21
To: sqlalchemy
Subject: [sqlalchemy] Re: Memory leak - is session.close() sufficient?
Thanks for all the advice - I've changed my unicode settings
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of John Hunter
Sent: 08 November 2008 05:09
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: select where field=max(field)
[SNIP]
Here is a query that lists the sum(pnl) for each
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of John Hunter
Sent: 11 November 2008 01:54
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: select where field=max(field)
On Mon, Nov 10, 2008 at 11:10 AM, Michael Bayer
[EMAIL
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Allen Bierbaum
Sent: 14 November 2008 16:40
To: sqlalchemy
Subject: [sqlalchemy] Re: Using deferred with declarative
Does anyone have any ideas on this?
Does declarative simply not
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of
---[EMAIL PROTECTED]@il06exr02.mot.com
Sent: 18 November 2008 10:04
To: sqlalchemy
Subject: [sqlalchemy] Re: Info needed regarding the use of cascade
Thank you Michael ,
you
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of SinJax
Sent: 21 November 2008 10:43
To: sqlalchemy
Subject: [sqlalchemy] Re: ORM mapping with Elixir compared to
raw cursor query
[SNIP]
sql =
SELECT annotations.id AS
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Doug Farrell
Sent: 28 November 2008 18:22
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] New instance ExtraStat with identity
key (...) conflicts with persistent instance ExtraStat
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Faheem Mitha
Sent: 04 December 2008 20:43
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] returning primary key of object without
know what it is called.
Hi,
I'm trying to
SQLALchemy doesn't (directly) contain functions for altering tables. You
may be interested in the sqlalchemy-migrate project:
http://code.google.com/p/sqlalchemy-migrate/
The first example on this page shows how to add a column:
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Andreas Jung
Sent: 19 December 2008 06:30
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: Efficient dictificationof result sets
On 19.12.2008 2:57 Uhr, Michael Bayer
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of abhishek
Sent: 20 January 2009 14:26
To: sqlalchemy
Subject: [sqlalchemy] how to use model.py file across
different applications
Hello all,
I have been using SQL Alchemy
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of Faheem Mitha
Sent: 20 January 2009 22:05
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] passing tuple argument into
sqlalchemy.sql.text string
Hi,
I've got a
Michael Bayer wrote:
i think using the polymorphic_map is OK. i downplayed its
existence since I felt it was confusing to people, which is
also the reason i made the _polymorphic_map argument to
mapper private; it was originally public. but it seemed
like it was producing two ways of
Micheal Bayer wrote:
id rather just add another plugin point on MapperExtension
for this, which takes place before the polymorphic decision
stage at the top of the _instance method, like
get_polymorphic_identity(). that way you could do all of
this stuff cleanly in an extension (and id do
Michael Bayer wrote:
Simon King wrote:
[requirements for instances returned from
MapperExtension.create_instance]
at this point the entity_name should get set after your
custom create_instance is called (at least thats in the
trunk). init_attr is not required, it pre-sets attributes on
Hi,
I don't know if this is valid SQL, but MySQL seems to accept it... I'd
like to write a query that looks like:
SELECT s.result LIKE 'Pass%' AS pass
...
Which would return 1 or 0 for each row depending on whether the result
column begins with Pass. In SQLAlchemy this would become:
Simon King wrote:
I don't know if this is valid SQL, but MySQL seems to accept
it... I'd like to write a query that looks like:
SELECT s.result LIKE 'Pass%' AS pass
...
Which would return 1 or 0 for each row depending on whether
the result column begins with Pass.
Another way I
Jose Soares wrote:
Hi all,
Probably this is a stupid question, :-[ but I don't
understand how to iterate an object mapper to get fields value.
---
user = session.query(User).select(id=1)
for j in user.c:
print j.name
logname
id
password
for j in user.c:
print
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
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 =
Adam M Peacock wrote:
Is there a difference in the SQL executed when using lazy vs eager
loading? Specifically, if I use eager loading will everything be
queried at once with a more efficient join, or will it still use the
lazy style (as far as I understand it) of generating a ton
Marco Mariani wrote:
Simon Willison wrote:
I've got a bit of code that looks like this:
session = get_session()
session.save(obj)
session.flush()
You can see what's going to be inserted/updated/deleted by
accessing session.new, session.dirty, session.deleted
percious wrote:
Here is the dump:
...snip...
sqlalchemy.exceptions.SQLError: (OperationalError) (1071,
'Specified key was too long; max key length is 999 bytes')
'\nCREATE TABLE `Album` (\n\tid INTEGER NOT NULL
AUTO_INCREMENT, \n\tname VARCHAR(128), \n\tdirectory
VARCHAR(512),
Knut Aksel Røysland wrote:
[snip]
However, an instance of D also needs a reference to an instance of C.
If the appropriate instance of C exists in the database (or
is pending to go into it), I want to pick this one, or
otherwise create a new instance of C.
What I am looking for is
I wanted to do something like this in the past, and in the end, rather
than using polymorphic mappers it made more sense to create a
MapperExtension which overrides create_instance. In create_instance you
can examine your 'typ' column to decide what class to create, selecting
one of your
Hi,
I have a problem in which a table is being removed from the FROM clause
of a nested query. The attached file should show the problem, which I've
tested on 0.3.5 and rev 2383.
In the example, there are two tables, department and employee, such that
one department has many employees. The inner
tml wrote:
also to clarify, the text actually has :table_name used in many other
places:
t = metadata.engine.text(LOCK TABLE :table_name WRITE;
UPDATE :table_name SET rgt=rgt +
2 WHERE rgt :insert_node_val and parent_id = :parent_id;
Hi,
I'm having a problem where the results of session.flush() vary from one
run to another of my test suite. The unit of work transaction dump is
significantly different from one run to the next, similar to the issue
in ticket 461. I haven't managed to make a test case small enough to
post to
what pairs of classes the UOW perceives as
dependent on each other.
On Mar 16, 2007, at 6:59 AM, King Simon-NFHD78 wrote:
Hi,
I'm having a problem where the results of session.flush() vary from
one run to another of my test suite. The unit of work
transaction dump
Michael Bayer wrote:
On Mar 17, 2007, at 11:39 AM, Simon King wrote:
I had assumed that post_update was only necessary when you are
inserting two rows that are mutually dependent, but in this case I
wasn't inserting either a ReleaseLine or a Label. I suppose
post_update can
This caught me out a couple of weeks ago, and I've seen a couple of
other similar questions as well. You need to add 'correlate=False' to
the nested select.
I wonder if this should be added to the FAQ?
Hope that helps,
Simon
-Original Message-
From: sqlalchemy@googlegroups.com
to model.
On Mar 28, 2007, at 10:39 AM, King Simon-NFHD78 wrote:
a_table = Table('a', metadata,
Column('id', Integer, primary_key=True),
Column('name', String(16)),
)
b_table = Table
Huy wrote:
Hi,
When using the generative limit() offset() or order_by calls
on mapper
query, the sql generated looks weird.
I get something like
select table1.* table2.*
from (select table1a.id from table1a limit 20 offset 0 order by
table1.col) as table_row, table1 join
Roger Demetrescu wrote:
On 4/11/07, King Simon-NFHD78 [EMAIL PROTECTED] wrote:
I've got no idea about the source of the problem, but it
would probably
be helpful if you could provide stack traces from the exceptions, if
that's possible.
Do you mean using the traceback module
Disrupt07 wrote
What is sqlalchemy.orm.attributes.InstrumentedList?
I need to use the sqlalchemy.orm.attributes.InstrumentedList type in
my Python controller methods and need to check if the type of another
object is of type sqlalchemy.orm.attributes.InstrumentedList. How can
I do
Disrupt07 wrote:
I have a table storing users' info.
table: userinfo
columns: name, surname, age, location, ...
I need to query this table using SQLAlchemy's ORM methods (e.g.
select(), select_by(), get_by()). The query should be like
SELECT * FROM userinfo WHERE name LIKE 'Ben%'
Disrupt07 wrote
@Simon
Thanks. But what is your_query? Is it SQLAlchemy or pure SQL?
It is a Query object, as described here:
http://www.sqlalchemy.org/docs/datamapping.html
If you haven't read them yet, I'd recommend working through a tutorial -
I found this one really helpful:
101 - 200 of 217 matches
Mail list logo