You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gump.apache.org by le...@apache.org on 2005/07/06 20:49:37 UTC
svn commit: r209497 -
/gump/branches/Gump3/pygump/python/gump/plugins/dynagumper.py
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"