On Jul 22, 1:33 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Jul 21, 2008, at 9:45 PM, huy do wrote:
Because a mapped class can have an arbitary select as it's source i.e
columns from any table theoretically, it would still be nice to know
exactly which columns were used to map
On Jul 20, 12:13 am, Michael Bayer [EMAIL PROTECTED] wrote:
On Jul 19, 2008, at 9:10 AM, Contact 42 wrote:
Hi,
I am using sa 0.5b2 under python 2.5.
Should the following code commit myobj.
engine = create_engine(appconfig.dburi, strategy='threadlocal')
Session =
Hi,
I read in the 0.5 release notes that the c attribute was no longer
necessary when doing queries using the mapped class, but I did not see
it mentioned that the c attribute was removed all together.
It's just that I've been using the c attribute in my Mapped classes to
access the
Michael Bayer wrote:
On Jun 25, 2008, at 10:48 AM, Huy Do wrote:
Hi,
I read in the 0.5 release notes that the c attribute was no longer
necessary when doing queries using the mapped class, but I did not see
it mentioned that the c attribute was removed all together.
It's just
Michael Bayer wrote:
using 0.5:
from sqlalchemy.orm import Query, sessionmaker
class MyQuery(Query):
def __new__(cls, entities, **kwargs):
if hasattr(entities[0], 'deleted_at'):
return Query(entities,
**kwargs).filter_by(deleted_at=None)
else:
Hi Rick,
I use a similar technique with a Pylons controller, but instead of
engine.begin(), I use session.begin(). Then by passing around the
session for all calls made by that controller,
I had so much legacy SA code, that I just couldn't easily retrofit this
pattern throughout the code,
I was hoping that I could create a another session using another
engine
(non threadlocal), for these special cases. I have not yet run into
this
need yet. Just out of interest, have you run into any such use cases ?
Thanks
if youre using threadlocal engine, you can still say
Hi,
I've just had a heck of a time getting transactions to behave correctly
after upgrading to 0.4dev from 0.3.6, and I just wanted to make sure
that I am doing things correctly.
I've found that to totally control transactions myself, and get ORM
sessions (i.e Session.flush()) to interact
Michael Bayer wrote:
On Nov 12, 2007, at 5:37 AM, Huy Do wrote:
Hi,
I've just had a heck of a time getting transactions to behave
correctly
after upgrading to 0.4dev from 0.3.6, and I just wanted to make sure
that I am doing things correctly.
I've found that to totally control
I think this would be a great feature to have because there are
many use
cases in my application (mainly displaying/processing tables) where I
don't want/need the overhead of the instrumentation (and it really
does
add quite a bit), but would still love the excellent mapping abilities
Hi,
Is it possible to get SA ORM to return plain python objects (with
eagerloaded relations and all) but without any attribute instrumentation
(or anything else magically added by SA).
Thanks,
Huy
--~--~-~--~~~---~--~~
You received this message because you
Michael Bayer wrote:
On Sep 24, 2007, at 11:48 AM, Huy Do wrote:
Hi,
Is it possible to get SA ORM to return plain python objects (with
eagerloaded relations and all) but without any attribute
instrumentation
(or anything else magically added by SA).
not really. unless
Michael Bayer wrote:
On Jun 30, 6:54 am, Huy Do [EMAIL PROTECTED] wrote:
This is my problem. I have cascade delete on one of my tables, and when
i try to delete a record, i get the null not allowed in foreign key
error. This happens because SA is trying to update my child records when
i
Michael Bayer wrote:
On Jun 29, 2007, at 10:38 AM, Huy Do wrote:
Hi,
How do I configure my mapper/table to leave the cascade up to my
database. i.e I don't want SA to auto update or delete my child
objects
when I delete or update my parent object.
you are probably looking
Hi,
How do I configure my mapper/table to leave the cascade up to my
database. i.e I don't want SA to auto update or delete my child objects
when I delete or update my parent object.
Thanks
Huy
--~--~-~--~~~---~--~~
You received this message because you are
I think you should listen to that error message.
user.id must appear in the group by or be used in an aggregate
function i.e count, sum, avg etc.
The other problem you are using the ORM interface. You should be using
the SQL select.
I'm not sure what you are trying to achieve, but your
Michael Bayer wrote:
On Jun 7, 2007, at 7:17 AM, Huy Do wrote:
Michael Bayer wrote:
put strings into group_by:
group_by = [client_code, client_name, ...]
Hi Michael,
Sorry I'm not sure what you are suggesting. I don't really want to
retype my column names again
],
group_by = [col.name http://col.name for col in group_by],
On 6/7/07, *Michael Bayer* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
On Jun 7, 2007, at 7:17 AM, Huy Do wrote:
Michael Bayer wrote:
put strings into group_by:
group_by = [client_code
or label_name.
If i use use_labels option for the select statement, it works, because
then the label names are unique across all columns.
thanks
Huy
On 6/7/07, *Michael Bayer* [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
On Jun 7, 2007, at 7:17 AM, Huy Do wrote:
Michael Bayer
in the group
by clause.
Thanks,
Huy
On Jun 6, 2007, at 7:07 PM, Huy Do wrote:
Hi,
I am trying to reuse my column list in my group by clause but some
of my
columns use label() which is causing a sql syntax error because of the
column as label in the group by clause. Is it possible
Hi,
I am trying to reuse my column list in my group by clause but some of my
columns use label() which is causing a sql syntax error because of the
column as label in the group by clause. Is it possible to get the
group_by to only use the label side of a column .
eg. (This doesn't work
Michael Bayer wrote:
I want to wake this thread up again. can we get some arguments pro/
con to converting select() to work in a generative style ?
generative means either just the first, or both of these two things:
- methods like append_whereclause() return a select object with
which to
Marco Mariani wrote:
Sanjay ha scritto:
Need help on how to do it. Being a turbogears application where db
entities like metadata and session are imported rather than created by
me, I am confused and could not successfully implement the pattern
provided in the docs.
I'm sure
Michael Bayer wrote:
On Jun 4, 2007, at 6:47 PM, nathan harmston wrote:
What kind of overhead is associated with using the autoload flag?
What kind of overhead would be associated with this over a network?
(with a remote database). Is there a way to dump the structure of
a database
wongobongo wrote:
You mean something like this?
K
---
# Running a SQL Statement using SQLAlchemy
from sqlalchemy import *
dsn = 'mysql://root:[EMAIL PROTECTED]:3306/tester'
# Create a database engine
db = create_engine(dsn)
# Do some SQL
text(INSERT INTO insertable SELECT
Michael Bayer wrote:
On May 29, 2007, at 10:28 PM, Huy Do wrote:
s = select()
query = db.query(model.Invoice).options(contains_eager('client'))
query = query.from_select(s) #
query = query.limit(10).offset(10)
rs = query.list()
What I'm doing, is pretty much setting up a query
Hi,
I am currently doing the following query:
s = select()
query = db.query(model.Invoice).options(contains_eager('client'))
rs = query.instances(s.execute())
I was wondering if it was possible to instead of query.instances(), just
attached the select to the query object, then continue to
Hi,
I am having problems getting transactions working.
I am calling conn.begin() but before I call trans.commit(), something
else commits for me.
It is committing right after I do the job_insert.execute(). Can someone
shed some light.
Many Thanks
Huy
I have the following code
Michael Bayer wrote:
On Apr 19, 2007, at 11:52 AM, Huy Do wrote:
I have the following code
trans = db.engine.contextual_connect().begin
try:
for client_id in slist.keys():
job_insert.execute( )
job_id = engine.func.currval
Michael Bayer wrote:
On Apr 7, 2007, at 8:11 AM, HD Mail wrote:
Hi,
I was after some opinions on the following use of SA.
1. Is there any problems using SA in this way ?
2. Is there better ways of achieving this ?
...
query =
30 matches
Mail list logo