gump-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From leosim...@apache.org
Subject svn commit: r209497 - /gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py
Date Wed, 06 Jul 2005 18:49:37 GMT
Author: leosimons
Date: Wed Jul  6 11:49:34 2005
New Revision: 209497

URL: http://svn.apache.org/viewcvs?rev=209497&view=rev
Log:
Deal with the 'None' in adding projects to DB (we don't want to add that, but use NULL instead)

Modified:
    gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py

Modified: gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py
URL: http://svn.apache.org/viewcvs/gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py?rev=209497&r1=209496&r2=209497&view=diff
==============================================================================
--- gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py (original)
+++ gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py Wed Jul  6 11:49:34 2005
@@ -211,23 +211,25 @@
         cmd = "SELECT * FROM %s WHERE id = '%s';" % (tablename, id)
         (rows, result) = self.db.execute(cmd)
                 
-        # Gather data
-        description = None
-        if hasattr(project,'description'): description = project.description
-        
         # Store into database...
         if rows == 0:
             # Insert
-            cmd = """INSERT INTO %s (name, description, module_id, id)
-                     VALUES ('%s', '%s', '%s', '%s')""" \
-                % (tablename, project.name, description, module_id, id)
+            cmd = """INSERT INTO %s (name, module_id, id)
+                     VALUES ('%s', '%s', '%s')""" \
+                % (tablename, project.name, module_id, id)
         else:
             # Update
-            cmd = """UPDATE %s SET description='%s',module_id='%s',name='%s'
+            cmd = """UPDATE %s SET module_id='%s',name='%s'
                      WHERE id = '%s';""" \
-                % (tablename, description, module_id, project.name, id)
+                % (tablename, module_id, project.name, id)
         self.db.execute(cmd)
     
+        # Gather optional data
+        if hasattr(project,'description'):
+            description = project.description
+            cmd = """UPDATE %s SET description='%s' WHERE id = '%s';"""
+            self.db.execute(cmd)
+        
     def _add_project_version_to_db(self, project):
         tablename = "project_versions"
         



Mime
View raw message