Joe Riopel, środa 07 stycznia 2009 15:51: > def deletePerson(self): > person_id = int(request.GET["personId"]) > p = Session.query(Person).filter_by(id=person_id).first() > if p: > Session.delete(p) > Session.commit() > return redirect_to(action="list") > > Is it normal, when using sqlalchemy, to have to select the Person > object first, then delete it?
Of course not. Try: Session.query(Person).filter_by(...).delete() .pk. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-discuss@googlegroups.com To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---