added new functions
authorMax Usachev <maxusachev@gmail.com>
Wed, 9 Jun 2010 11:35:16 +0000 (14:35 +0300)
committerMax Usachev <maxusachev@gmail.com>
Wed, 9 Jun 2010 11:35:16 +0000 (14:35 +0300)
database/SQLite.py

index 2da8a8b..a4a7d36 100644 (file)
@@ -117,6 +117,14 @@ class SQLite:
 
         self.conn.commit()
 
+    def get_entry(self, value):
+        """Gets full entry imformation from DATA table."""
+
+        _id = self.conn.execute("SELECT id FROM data WHERE value=?", \
+            (value,)).fetchone()[0]
+        return dict([(key, value) for key, value in self.conn.execute("\
+            SELECT field_id, value FROM data WHERE id=?", (_id,)).fetchall()])
+
     def get_toplevel_entries(self):
         """Returns list of all toplevel entries from DATA table."""