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
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;
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
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
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),
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
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
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 =
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
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
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
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:
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
201 - 217 of 217 matches
Mail list logo