would be better upon compilation, since its entirely valid to create an empty Select object and then append columns to it later.  the Query object  does it exactly this way.

also, feel free to make all the exceptions pull from a locale-based file, and the error string you propose would be in the "Camelot" locale :).

On Jul 24, 2006, at 6:08 PM, Jonathan Ellis wrote:

To make it more general, would

if not self._raw_columns:
  raise 'thou shalt not have a select with no columns'

work in the Select constructor?

On 7/23/06, Michael Bayer <[EMAIL PROTECTED]> wrote:
sure, check in what you think it should say.

On Jul 23, 2006, at 7:05 PM, Jonathan Ellis wrote:

Ah, okay.

Can the exception raised be improved for others making the same mistake?

On 7/23/06, Michael Bayer < [EMAIL PROTECTED]> wrote:
the select(use_labels=True, from_obj=[j]) has no columns in it:

str(select(use_labels=True, from_obj=[j]))

SELECT 
FROM users JOIN email_addresses ON users.user_id = email_addresses.user_id

you probably want:

            s = j.select(use_labels=True).alias('foo')

On Jul 21, 2006, at 10:21 PM, Jonathan Ellis wrote:

def testjoinwithlabels(self):
        class UserWithAddress(object):
            pass
        j = join(users, addresses)
        s = select(use_labels=True, from_obj=[j]).alias('foo') 
        m = mapper(UserWithAddress, s)
        q = create_session().query(m)




--
Jonathan Ellis
http://spyced.blogspot.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
Sqlalchemy-users mailing list




--
Jonathan Ellis
http://spyced.blogspot.com

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to