summaryrefslogtreecommitdiff
path: root/portato/db/sql.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-03-02 21:49:22 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-03-02 21:49:22 +0100
commit980f6b90fe2ad4b4ec95d13bb6472bb949b215b1 (patch)
treeba38063a176a97458c1a451153a51242e660e832 /portato/db/sql.py
parent3cd0926203e1a6e7c8bd50a8195336c85daf9f25 (diff)
downloadportato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.tar.gz
portato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.tar.bz2
portato-980f6b90fe2ad4b4ec95d13bb6472bb949b215b1.zip
Fixed interactive search with category names
Diffstat (limited to 'portato/db/sql.py')
-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..b794d08 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)