i think there was .one() to return one and only one and die otherwise i.e. match {1}, and first() or similar that allows match {0,1}.
On Friday 20 July 2007 18:42:56 Marco De Felice wrote: > Hi all for my first post > I'm using the new one() method like this: > > query(Table).filter_by(and_(Table.c.field1 == val1, Table.c.field2 > == val2)).one() > > filed1 + field2 has a unique constraint in Table, so there won't > never be more than one row returned, but there may be none. > When there's none I get an InvalidRequestError, would'nt it be > better to return something else (None ?) or am i missing something > ? > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---