Michael Bayer wrote:
> ...
>
> now. should we just have session.connection() and have the mapper
> argument be optional ? I chose to make it required to start with, based
> on "explicit is better than implicit". since in most cases these days,
> people have the engine accessible via the Ta
I'm looking at writing a TurboGears-based application where I'll have
cause to use not only UNION but also INTERSECT and EXCEPT. The
SQLAlchemy documentation appears to indicate that only UNION is supported.
Is there any chance of INTERSECT or EXCEPT showing up in future versions
of SQLAlchemy?
the latest trunk uses deferred mapper compilation and solves this
problem (ticket #194 in trac: http://www.sqlalchemy.org/trac/ticket/
194 )
On Jun 13, 2006, at 5:44 PM, Randall Smith wrote:
> I've got 200+ tables with lots of relationships that I'm trying to map
> SQLAlchemy to. I'm writin
Thanks Michael,
I should have read the docs a bit more carefully.
I have one more question which is sort of related (but has more to do
with 0.1 -> 0.2 migration)
In 0.1, I used the following idiom:
engine.begin()
try:
engine.commit()
except:
engine.rollback()
is the equivalent in 0.2, usin
I've got 200+ tables with lots of relationships that I'm trying to map
SQLAlchemy to. I'm writing a code generator to create the classes,
mappings, etc. A problem that I don't see a simple solution to is
writing the mapper code in the proper order. If I attempt to map one
class to another th
you can define them for the purposes of querying and mapping just as
separate ForeignKey objects (i.e ForeignKey(customer_id) on
customer_id, ForeignKey(username) on username), and it will figure
out all the appropriate join conditions connected by AND.
for the purposes of having the metadat
the count(stockproducts.c.id) is internal to the subquery that you
are mapping to, and its an aggregate for how many rows in
stockproducts match each product id. it cant be changed by external
criterion. the easiest query to map to for this is:
select products.id, products.name, count(stoc
Michael Bayer wrote:
>
> On Jun 13, 2006, at 4:03 AM, Lele Gaifax wrote:
>
>>
>> Wouldn't something like
>>
>>diary = FunctTable('diary(:iddip,:fromdate,:todate,:live)', ...)
>>
>> be a viable solution to the problem as well as a nicer approach to
>> ticket #172, if at all possible?
>>
>
> y
you could use the table directly:
t = class_mapper(MyClass).mapped_table
t.delete().execute()
select([t.c.col1, t.c.col2]).execute()
On Jun 13, 2006, at 3:23 AM, Chetan Thapliyal wrote:
> Hi
>
> I have two queries.
>
> 1. How can I delete multiple rows (may be all) of a table using
> sess
yeah use the sessioncontext extension module.
http://www.sqlalchemy.org/docs/plugins.myt#plugins_sessioncontext
import sqlalchemy
from sqlalchemy.ext.sessioncontext import SessionContext
ctx = SessionContext(sqlalchemy.create_session)
obj = MyObject()
ctx.current.save(obj)
ctx.current.flush(
On Jun 13, 2006, at 4:03 AM, Lele Gaifax wrote:
>
> Wouldn't something like
>
>diary = FunctTable('diary(:iddip,:fromdate,:todate,:live)', ...)
>
> be a viable solution to the problem as well as a nicer approach to
> ticket #172, if at all possible?
>
yes this is why I put all those notes of
the session does bind to a single engine most easily:
s = create_session(bind_to=engine)
then you can in fact say:
conn = session.connection(None)
now. should we just have session.connection() and have the mapper
argument be optional ? I chose to make it required to start wi
Hi there..
Is is it possible to describe multi-column foreign keys with SA metadata?
I.e.
create table customers (
customer_id string,
primary key (customer_id)
)
create table users (
customer_id string,
username string,
primary key (customer_id, username),
foreign key (customer_id) references
Hi,
Is it possible to get the functionality of the threadlocal plugin (i.e
objectstore/default thread local session), but not have all my mapped
classes automatically added to the objectstore when i instantiate them ?
I am willing to call "save" on objects I want to save.
Many Thanks,
Huy
_
Hi
I have two queries.
1. How can I delete multiple rows (may be all) of a table using session
query object based on a specific python class that is binded to a table
using mapper?
2. Is there any way of selecting only specific columns of a table using
the same session query object as above.
Michael Bayer wrote:
> ideally you should be able to say:
>
> func.diary(iddip, fromd, tod, True).select()
>
> however this will produce "SELECT diary(?, ?, ?, ?)" which isnt going to
> work since its naming the function as a column. Function objects in SA
> currently are designed to follo
16 matches
Mail list logo