summaryrefslogtreecommitdiff
path: root/db.py
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2012-12-21 22:07:45 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2012-12-21 22:07:45 +0100
commite745764fc55043f6107f68986f82845310537fee (patch)
treeca8923d2b98f304759afa5799eebd25f129165d2 /db.py
parent1134dc1efa6a4326424cf7b1271cb4465afb712d (diff)
Added feedback and limits to searches.
Diffstat (limited to 'db.py')
-rw-r--r--db.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/db.py b/db.py
index e680448..ed53fdb 100644
--- a/db.py
+++ b/db.py
@@ -177,11 +177,16 @@ class Track(Base):
r = r.join(f)
if n in kwargs:
r = r.filter(f.name.ilike('%{0}%'.format(kwargs[n])))
+ s_and = []
for i in args:
- s_or.append(f.name.ilike('%{0}%'.format(i)))
+ s_and.append(f.name.ilike('%{0}%'.format(i)))
+ s_or.append(and_(*s_and))
if len(s_or):
r = r.filter(or_(*s_or))
- return r.all()
+ r = r#.limit(100)
+ #.all()
+ #print r
+ return r
def get_path(self):
return os.path.join(self.directory.path, self.filename)