changeset 52:9cb57c37369a

fix insert new project sql statemenent and api
author Björn Ricks <bjoern.ricks@intevation.de>
date Mon, 04 Apr 2011 12:13:40 +0200
parents 3f97954868e4
children 1d63ab21b8af
files getan/backend.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/getan/backend.py	Wed Mar 23 11:04:28 2011 +0100
+++ b/getan/backend.py	Mon Apr 04 12:13:40 2011 +0200
@@ -75,7 +75,7 @@
 '''
 
 INSERT_PROJECT = '''
-INSERT INTO projects (id, key, description, active) VALUES (?,?,?,1)
+INSERT INTO projects (key, description, active) VALUES (?,?,1)
 '''
 
 DELETE_PROJECT_ENTRY = 'DELETE FROM entries WHERE id = %i'
@@ -179,15 +179,15 @@
         finally:
             close(cur)
 
-    def insert_project(self, project, key, description):
-        if project is None:
+    def insert_project(self, key, description):
+        if key is None or description is None:
             return
         cur = None
         try:
             cur = self.con.cursor()
-            cur.execute(INSERT_PROJECT, (project, key, description))
+            cur.execute(INSERT_PROJECT, (key, description))
             self.con.commit()
-            logger.debug("Added a new project '%s' into db" % project)
+            logger.debug("Added a new project '%s' into db" % description)
         finally:
             close(cur)
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)