Hello, I am working on a Google App Engine application, and have been facing some issues with a GQL query and an if statement. This is the code:
q = Song.gql("WHERE title = :1", self.request.get('song_title'))
q.get()
if q:
r = "Excisting Results Found: <br />"
print q
for song in q:
r += song.title+" by "+song.artist+"<br />"
self.response.out.write(r)
else:
...
When this is run, the page returns "Excisting Results Found:" however I know that no results were in fact found. Is there a way to check if the results returned by the query are empty? What would a blank result returned from GqlQuery
look like?
Any help would be greatly appreciated,
Thanks.