Пример #1
0
 def update(self, obj):
     try:
         db_session.merge(obj)
         db_session.commit()
         return obj
     except Exception:
         db_session.rollback()
         return 'fail'
Пример #2
0
 def update(self, obj):
     try:
         db_session.merge(obj)
         db_session.commit()
         return self.findById(obj.id)
     except Exception:
         db_session.rollback()
         return obj