Hi Ryan, On Apr 7, 6:10 pm, "rkennedy" <[EMAIL PROTECTED]> wrote: > I'm new to SQLAlchemy and am trying to select objects from the > following table that occurred before a specified date.
I'm pretty new myself, but I've been reading the docs a bunch today and I may be able to help. > event_table = Table('event', meta, > Column('event_id', Integer, primary_key=True), > Column('title', String()), > Column('start_time', DateTime,default=func.now()), > Column('stop_time', DateTime,default=func.now()), > ) [snip] > event = self.sess.query(model.Event).get_by(start_time < '2007-10-19 > 10:23:54') I think that when you use get_by this way you are supplying a keyword argument and not referencing a column name. Try something like (untested): event = self.sess.query(model.Event).get_by(event_table.c.start_time < '2007-10-19 10:23:54') That builds a ClauseElement that should do what you want (if I understand correctly). I hope I'm correct and this is helpful. Regards, Matthew --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---