1. Michael Bayer
  2. sqlalchemy
  3. Issues

Issues

Issue #13 resolved

Shorthand for multiple column comparisons

Ben Bangert
created an issue

When testing for multiple column equivilants, specifying the full class for each column becomes a chore, take this example:

# load a User from the database            
sqlmyuser = User.mapper.select(User.c.user_name=='fred', User.c.password=='something',
                                                   User.c.email=='someone@somewhere.com')

If we use a slightly different keyword (inspired by SQLObject notation) like so:

# load a User from the database            
sqlmyuser = User.mapper.select_by(user_name='fred', password='something', email='someone@somewhere.com')

We save ourselves a bit of repetitive typing. I come across usage like this fairly often so I think it'd be rather useful in SQLAlchemy as well.

Comments (3)

  1. Log in to comment