[Getan-commits] [PATCH] Adjusting starting datetime:

Wald Commits scm-commit at wald.intevation.org
Mon Sep 12 11:07:01 CEST 2016


# HG changeset patch
# User Bernhard Reiter <bernhard at intevation.de>
# Date 1473671206 -7200
# Node ID a487535e78449037c8698dfae5d70cc3a69c2e19
# Parent  527168c08ae46f396fe362dcab5b77f2b90cb004
Adjusting starting datetime:

update_entry() now also updatest start and end time.

diff -r 527168c08ae4 -r a487535e7844 getan/backend.py
--- a/getan/backend.py	Mon Sep 12 10:19:21 2016 +0200
+++ b/getan/backend.py	Mon Sep 12 11:06:46 2016 +0200
@@ -152,9 +152,13 @@
 
 MOVE_ENTRY = 'UPDATE entries SET project_id = ? WHERE id = ?'
 
-UPDATE_ENTRY = 'UPDATE entries SET description = ? WHERE id = ?'
+UPDATE_ENTRY = '''
+UPDATE entries
+    SET description = ?, start_time = ?, stop_time = ?
+    WHERE id = ?
+'''
 
-UPDATE_PROJECT = "UPDATE projects SET key = ?, description = ? WHERE id = ?"
+UPDATE_PROJECT = 'UPDATE projects SET key = ?, description = ? WHERE id = ?'
 
 logger = logging.getLogger()
 
@@ -342,9 +346,10 @@
         cur = None
         try:
             cur = self.con.cursor()
-            cur.execute(UPDATE_ENTRY, (entry.desc, entry.id))
+            cur.execute(UPDATE_ENTRY, (entry.desc, entry.start,
+                                       entry.end, entry.id))
             self.con.commit()
-            logger.debug("Updated entry: '%s' (%d)" % (entry.desc, entry.id))
+            logger.debug("Updated entry to: '%s'" % (entry))
         finally:
             close(cur)
 


More information about the Getan-commits mailing list