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
In fact what I want to be able to do is :
select a.id, (select b.name from invasive_names b, languages c where
b.invasive_id=a.id and b.language_id=c.id and c.iso_code='en') as
name_en from invasives a order by foo;
where mappers are : a = Invasive, b = InvasiveName, c = Language
Julien
Hi there
This relates to Turbogears, but is really a SA question.
I've customized TG authentication authorization to use my autloaded
tables in Postgres and SqlAlchemy 0.3.3.
In my schema, I have User.c.uid, the login name of the users, as a
primary key
TG uses a User mapper with two
what is the easiest way to find out the last insert id? (MySQL 5)
supplast =
select([func.last_insert_id()],app_schema.SupplierTable.c.pr_supplier_ID
0).execute().fetchone()[0]
does not work for some reason
Dennis
--~--~-~--~~~---~--~~
You received this
Thanks, I will give that a try.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to
You can shorten it a little by having the db do the date operation:
History.c.ts_created func.now() - '90 minutes'
On 1/11/07, Chris Shenton [EMAIL PROTECTED] wrote:
I've got a bunch of history and other timestamped information I will
need to query against. The columns are created with type
to have aliases of properties that are usable with get_by(), use the
synonym function, described in:
http://www.sqlalchemy.org/docs/adv_datamapping.myt#advdatamapping_properties_overriding
--~--~-~--~~~---~--~~
You received this message because you are
Julien Cigar wrote:
In fact what I want to be able to do is :
select a.id, (select b.name from invasive_names b, languages c where
b.invasive_id=a.id and b.language_id=c.id and c.iso_code='en') as
name_en from invasives a order by foo;
where mappers are : a = Invasive, b = InvasiveName, c
King Simon-NFHD78 wrote:
class EmployeeMapperExtension(sa.MapperExtension):
def create_instance(self, mapper, selectcontext, row, class_):
cls = get_employee_class(row[employee_table.c.kind])
if class_ != cls:
return
uggh, pysqlite 2.1 fixed some other problems I was having in
transactions iirc. I'm scared to upgrade/downgrade :(
On 1/11/07, Michael Bayer [EMAIL PROTECTED] wrote:
the important thing is your sqlite version. im on 3.2.1. my
pysqlite seems to be2.0.2 ? maybe a new pysqlite bug, not
oh, nice. upgrading sqlite to 3.3.7 and rebuilding pysqlite2 fixed it
-- sorry for the noise.
On 1/12/07, Kumar McMillan [EMAIL PROTECTED] wrote:
uggh, pysqlite 2.1 fixed some other problems I was having in
transactions iirc. I'm scared to upgrade/downgrade :(
On 1/11/07, Michael Bayer
Okay, I have another question related to this.
Now that I have max_order defined, I want to do a query on it (give me
the users whose max_order==5). My code is
max_orders_by_user =
select([func.max(orders.c.order_id).label('order_id')],
group_by=[orders.c.user_id]).alias('max_orders_by_user')
errr, the relations that mapper setup can feed into select_by would
include all the attributes you have on Order, which does not include
max_order_id. youve got two relations that both point to an Order
relation, so select_by is more or less out at that point since it can
only be given order_id,
13 matches
Mail list logo