[sqlalchemy] Unicode URL error

2007-03-30 Thread Andrew Stromnov
ascii-encoded string: url = 'mysql://login:[EMAIL PROTECTED]/adverts?charset=cp1251' engine = sqlalchemy.create_engine(url, convert_unicode=True, pool_recycle=4) metadata = sqlalchemy.BoundMetaData(engine) ad_table = sqlalchemy.Table('adverts', metadata, autoload=True) unicode string:

[sqlalchemy] order_by computed on wrong table with many-to-many

2007-03-30 Thread Alexandre CONRAD
Hello, I have a problem with order_by on a many-to-many relationship (using assign_mapper): -- attachment_table = Table('attachments', meta, Column('id', Integer, primary_key=True), Column('file', Binary, nullable=False), Column('name', Unicode(40),

[sqlalchemy] Re: alias not used with relationship to arbitary select

2007-03-30 Thread hdmail
Thanks Michael. it works as you've described. Huy put the order_by in your status relation. On Mar 26, 2007, at 12:23 PM, HD Mail wrote: I think the issue is you cant put a task_status ordering in your Task mapper since that table is not part of its mapping.

[sqlalchemy] Subselect is preventing additional where conditions--help

2007-03-30 Thread Paul Kippes
I'm trying to create a subselect that has a where condition using an identically named column as the outer select. I'm not able to figure out how to tell SQLAlchemy that I need two parameters--one for each query. Here is what my SQL would look like if I wrote it by hand: SELECT signals.*

[sqlalchemy] print SQL only

2007-03-30 Thread ml
Hi! I want meta.create_all() to generate and print the SQL only and don't query the DB. Is there any way? Thanks for advices. David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to

[sqlalchemy] Re: order_by computed on wrong table with many-to-many

2007-03-30 Thread Michael Bayer
use 'sites':relation(Site, backref=backref('attachments', order_by=attachment_table.c.name)) for now. On Mar 30, 5:50 am, Alexandre CONRAD [EMAIL PROTECTED] wrote: Hello, I have a problem with order_by on a many-to-many relationship (using assign_mapper): --

[sqlalchemy] Re: Subselect is preventing additional where conditions--help

2007-03-30 Thread Michael Bayer
On Mar 30, 10:54 am, Paul Kippes [EMAIL PROTECTED] wrote: I'm trying to create a subselect that has a where condition using an identically named column as the outer select. I'm not able to figure out how to tell SQLAlchemy that I need two parameters--one for each query. Here is what my SQL

[sqlalchemy] Re: Unicode URL error

2007-03-30 Thread Michael Bayer
fix in changeset 2475 On Mar 30, 5:19 am, Andrew Stromnov [EMAIL PROTECTED] wrote: ascii-encoded string: url = 'mysql://login:[EMAIL PROTECTED]/adverts?charset=cp1251' engine = sqlalchemy.create_engine(url, convert_unicode=True, pool_recycle=4) metadata =

[sqlalchemy] Re: [PATCH] Filtered one_to_many relationships (Experimental)

2007-03-30 Thread Gaetan de Menten
On 3/26/07, Michael Bayer [EMAIL PROTECTED] wrote: (and whether that be a .query() or Query() or SelectResults not big difference imo.) i vote Query(). I tried to implement it but I couldn't do it the way I wanted to. The problem is: how do I construct a clause from a clause with bind

[sqlalchemy] Re: print SQL only

2007-03-30 Thread Michael Bayer
this approach should work for now, but will need some small modifications in the next release of SA (i.e. it should be easier): from sqlalchemy import * class FakeDBAPI(object): def __init__(self): self.paramstyle = 'named' e = create_engine('oracle://', module=FakeDBAPI()) #

[sqlalchemy] Re: Inserting a node in basic_tree.py

2007-03-30 Thread Michael Bayer
the treenodes table has no explicit sorting field, so by default it will sort by either the row ID of the table or the primary key field. the only operation that can be issued to the database when you add an item to the list is INSERT, so this will always assemble new nodes as the last element in

[sqlalchemy] Re: Is there an easy way to convert a ResultProxy object (returned back from an execute) to a dict

2007-03-30 Thread Rick Morrison
Fetched resultproxy objects have dictionary semantics, and most things that expect dictionaries will work fine with them. Make sure you've fetched all your results (via .fetchall()) before handing them off for processing. Rick On 3/30/07, vinjvinj [EMAIL PROTECTED] wrote: I'm putting the rows