[billreminder] Initial code for method to edit db objects. Work in progress.
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [billreminder] Initial code for method to edit db objects. Work in progress.
- Date: Sat, 14 Nov 2009 20:59:15 +0000 (UTC)
commit 1460778c44851da6571f001f8a9f39177fffbca1
Author: Og B. Maciel <ogmaciel gnome org>
Date: Sat Nov 14 15:55:37 2009 -0500
Initial code for method to edit db objects. Work in progress.
src/lib/dal.py | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/lib/dal.py b/src/lib/dal.py
index 4d804cc..396dbe6 100644
--- a/src/lib/dal.py
+++ b/src/lib/dal.py
@@ -44,6 +44,19 @@ class DAL(object):
finally:
session.close()
+ def edit(self, dbobject):
+
+ session = self.Session()
+
+ if session.dirty:
+ try:
+ session.commit()
+ except Exception, e:
+ session.rollback()
+ print str(e)
+ finally:
+ session.close()
+
def delete(self, dbobjects):
if not isinstance(dbobjects, list):
dbobjects = [dbobjects]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]