diff idavoll/pgsql_backend.py @ 98:b9c449f4c167

Removed debugging junk
author Ralph Meijer <ralphm@ik.nu>
date Wed, 24 Nov 2004 20:08:28 +0000
parents 3ad74552bbc7
children 8d8946e67fcb
line wrap: on
line diff
--- a/idavoll/pgsql_backend.py	Tue Nov 23 17:05:21 2004 +0000
+++ b/idavoll/pgsql_backend.py	Wed Nov 24 20:08:28 2004 +0000
@@ -177,17 +177,14 @@
             cursor.execute("""INSERT INTO entities (jid) VALUES (%s)""",
                            (owner.full().encode('utf8')))
 
-        try:
-            cursor.execute("""INSERT INTO affiliations
-                              (node_id, entity_id, affiliation)
-                              SELECT n.id, e.id, 'owner' FROM
-                              (SELECT id FROM nodes WHERE node=%s) AS n
-                              CROSS JOIN
-                              (SELECT id FROM entities WHERE jid=%s) AS e""",
-                           (node_id.encode('utf8'),
-                            owner.full().encode('utf8')))
-        except Exception, e:
-            print e
+        cursor.execute("""INSERT INTO affiliations
+                          (node_id, entity_id, affiliation)
+                          SELECT n.id, e.id, 'owner' FROM
+                          (SELECT id FROM nodes WHERE node=%s) AS n
+                          CROSS JOIN
+                          (SELECT id FROM entities WHERE jid=%s) AS e""",
+                       (node_id.encode('utf8'),
+                        owner.full().encode('utf8')))
 
         return None
 
@@ -276,15 +273,12 @@
         query = """SELECT data FROM nodes JOIN items ON
                    (nodes.id=items.node_id)
                    WHERE node=%s ORDER BY date DESC"""
-        try:
-            if max_items:
-                cursor.execute(query + " LIMIT %s",
-                               (node_id.encode('utf8'),
-                                max_items))
-            else:
-                cursor.execute(query, (node_id.encode('utf8')))
-        except Exception, e:
-            print e
+        if max_items:
+            cursor.execute(query + " LIMIT %s",
+                           (node_id.encode('utf8'),
+                            max_items))
+        else:
+            cursor.execute(query, (node_id.encode('utf8')))
 
         result = cursor.fetchall()
         return [r[0] for r in result]