r = self.conn.execute(s)
r.close()
+ def public_unset_bulk(self, paths):
+ s = self.public.update()
+ s = s.where(self.public.c.path.in_(paths))
+ s = s.values(active=False)
+ r = self.conn.execute(s)
+ r.close()
+
def public_get(self, path):
s = select([self.public.c.public_id])
s = s.where(and_(self.public.c.path == path,
- self.public.c.active == True))
+ self.public.c.active == True))
r = self.conn.execute(s)
row = r.fetchone()
r.close()
return row[0]
return None
+ def public_list(self, prefix):
+ s = select([self.public.c.path, self.public.c.public_id])
+ s = s.where(self.public.c.path.like(self.escape_like(prefix) + '%', escape='\\'))
+ s = s.where(self.public.c.active == True)
+ r = self.conn.execute(s)
+ rows = r.fetchall()
+ r.close()
+ return rows
+
def public_path(self, public):
s = select([self.public.c.path])
s = s.where(and_(self.public.c.public_id == public,
- self.public.c.active == True))
+ self.public.c.active == True))
r = self.conn.execute(s)
row = r.fetchone()
r.close()