[billreminder] Apparently I was not handling alarmDate correctly and passing a float instead of a datetime object.
- From: Og B. Maciel <ogmaciel src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [billreminder] Apparently I was not handling alarmDate correctly and passing a float instead of a datetime object.
- Date: Sun, 10 Jan 2010 23:19:08 +0000 (UTC)
commit 2df7db7ece3853f4cbee78f4e0593b94078c4c83
Author: Og B. Maciel <ogmaciel gnome org>
Date: Sun Jan 10 18:18:56 2010 -0500
Apparently I was not handling alarmDate correctly and passing a float instead of a datetime object. Also, the alarmDate property was not beeing saved.
src/gui/widgets/datebutton.py | 10 +++++-----
src/lib/dal.py | 3 ++-
2 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/gui/widgets/datebutton.py b/src/gui/widgets/datebutton.py
index 49ebb6b..8d844ea 100644
--- a/src/gui/widgets/datebutton.py
+++ b/src/gui/widgets/datebutton.py
@@ -34,7 +34,7 @@ class DateButton(gtk.Button):
def get_date(self):
if not self.date:
return None
- return time.mktime(self.date.timetuple())
+ return self.date
def show_calendar(self, *arg):
self.dialog = gtk.Dialog(title=_("Select Date and Time"),
@@ -46,12 +46,12 @@ class DateButton(gtk.Button):
self.dialog.set_border_width(6)
self.dialog.set_resizable(False)
self.dialog.vbox.set_spacing(6)
-
+
self._initialize_dialog_widgets()
self._populate_fields()
response = self.dialog.run()
-
+
if response == gtk.RESPONSE_REJECT:
self.set_date(None)
elif response == gtk.RESPONSE_OK:
@@ -72,10 +72,10 @@ class DateButton(gtk.Button):
flags=gtk.DIALOG_MODAL |gtk.DIALOG_DESTROY_WITH_PARENT |gtk.DIALOG_NO_SEPARATOR,
buttons=(str(_("_None")), gtk.RESPONSE_REJECT,
gtk.STOCK_OK, gtk.RESPONSE_OK))
-
+
dialog.set_border_width(6)
dialog.set_resizable(False)
-
+
if self.parent_window:
dialog.set_transient_for(self.parent_window)
dialog.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
diff --git a/src/lib/dal.py b/src/lib/dal.py
index eb46da3..027e9e2 100644
--- a/src/lib/dal.py
+++ b/src/lib/dal.py
@@ -42,6 +42,7 @@ class DAL(object):
bill.payee = dbobject.payee
bill.amount = dbobject.amount
bill.dueDate = dbobject.dueDate
+ bill.alarmDate = dbobject.alarmDate
bill.notes = dbobject.notes
bill.paid = dbobject.paid
if dbobject.category:
@@ -50,7 +51,7 @@ class DAL(object):
bill.category = category
except Exception, e:
print "Failed to retrieve category \"%s\" for bill \"%s\": %s" \
- % (dbobject.name, dbobject.category[0].name, str(e))
+ % (dbobject.payee, dbobject.category.name, str(e))
if session.dirty:
session.commit()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]