Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/places.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2008-06-12 21:18:29 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2008-06-12 21:18:29 (GMT)
commit6a0bd46b66ac7cfd4a8fec945e97a96125ed8e2a (patch)
treefbb0505b623f72f2ef8c852ac8692bc3e055116a /places.py
parent72be60992d01ba57ca98097974eb9ba2e6cb09b2 (diff)
Add a bookmark boolean field to mark bookmarks so that
we can give them an higer position in the queries.
Diffstat (limited to 'places.py')
-rw-r--r--places.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/places.py b/places.py
index 2850dee..821c894 100644
--- a/places.py
+++ b/places.py
@@ -26,6 +26,7 @@ class Place(object):
def __init__(self, uri=None):
self.uri = uri
self.title = None
+ self.bookmark = False
self.gecko_flags = 0
self.visits = 0
self.last_visit = datetime.now()
@@ -46,6 +47,7 @@ class SqliteStore(object):
cur.execute("""create table places (
uri text,
title text,
+ bookmark boolean,
gecko_flags integer,
visits integer,
last_visit timestamp
@@ -71,9 +73,9 @@ class SqliteStore(object):
def add_place(self, place):
cur = self._con.cursor()
- cur.execute('insert into places values (?, ?, ?, ?, ?)', \
- (place.uri, place.title, place.gecko_flags,
- place.visits, place.last_visit))
+ cur.execute('insert into places values (?, ?, ?, ?, ?, ?)', \
+ (place.uri, place.title, place.bookmark,
+ place.gecko_flags, place.visits, place.last_visit))
self._con.commit()
cur.close()
@@ -94,9 +96,9 @@ class SqliteStore(object):
cur = self._con.cursor()
cur.execute('update places set title=?, gecko_flags=?, '
- 'visits=?, last_visit=? where uri=?',
+ 'visits=?, last_visit=?, bookmark=? where uri=?',
(place.title, place.gecko_flags, place.visits,
- place.last_visit, place.uri))
+ place.last_visit, place.bookmark, place.uri))
self._con.commit()
cur.close()
@@ -104,7 +106,7 @@ class SqliteStore(object):
def _place_from_row(self, row):
place = Place()
- place.uri, place.title, place.gecko_flags, \
+ place.uri, place.title, place.bookmark, place.gecko_flags, \
place.visits, place.last_visit = row
return place