summaryrefslogtreecommitdiff
path: root/portato/db/sql.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-03-03 23:53:52 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-03-03 23:53:52 +0100
commit4c786bef98d6d8244a1c6e28abc5dd448902ecdf (patch)
treeaf67e8eeb5bd3ae257b1f6e87997b0090082d3c5 /portato/db/sql.py
parentc768119cc7ade2018f7ab0ae0da0515bee36de60 (diff)
parent6a6aba15ba92c805fe35da7dcbdaa37bacccb6fd (diff)
downloadportato-4c786bef98d6d8244a1c6e28abc5dd448902ecdf.tar.gz
portato-4c786bef98d6d8244a1c6e28abc5dd448902ecdf.tar.bz2
portato-4c786bef98d6d8244a1c6e28abc5dd448902ecdf.zip
Some more 0.12 stuff
Diffstat (limited to '')
-rw-r--r--portato/db/sql.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/portato/db/sql.py b/portato/db/sql.py
index cb252c1..6c95bb3 100644
--- a/portato/db/sql.py
+++ b/portato/db/sql.py
@@ -248,6 +248,11 @@ class SQLDatabase (Database):
self._restrict = ""
else:
restrict = restrict.replace(".*","%").replace(".","_")
- self._restrict = "AND name LIKE '%%%s%%'" % restrict
+
+ if "/" in restrict:
+ cat,pkg = restrict.split("/")
+ self._restrict = "AND name LIKE '%s%%' AND cat LIKE '%s'" % (pkg, cat)
+ else:
+ self._restrict = "AND (name LIKE '%%%(restrict)s%%' OR cat LIKE '%(restrict)s%%')" % {"restrict":restrict}
restrict = property(get_restrict, set_restrict)