class SearchController(BaseController):
def index(self):
- # Return a rendered template
- #return render('/search.mako')
- # or, return a response
- return 'Hello World'
-
- def results(self):
- """ Search, implemented the stupid way! """
- query = request.params.get('query','')
+ """Search, implemented the stupid way!"""
+ query = request.params.get('query', '')
tags = query.split()
-
+
tagtexts = TagText.query.filter(TagText.text.in_(tags))
tagtext_ids = [_.id for _ in tagtexts]
# Fetch art that has all the tags
c.artwork = Art.query.join(Tag) \
- .filter(Tag.id.in_(tagtext_ids)) \
+ .filter(Tag.tagtext_id.in_(tagtext_ids)) \
.all()
- return render('/index.mako')
+ return render('/index.mako')
\ No newline at end of file