I am trying to mix and match everything, and it seems like I can't find the right answer.
I am trying to use filter on Queries. But the result is as follows: if q!=None
, it generates a filter. But, if q==None
, it would not display any data after using run()
q = self.request.get('q')
if q!=None:
custQuery = db.Query(Customer)
custQuery.filter('license = ',q)
elif q==None:
custQuery = Customer.all()
But, if I replace all of them with just the following code below, it displays all the data.
custQuery = db.Query(Customer)
How do I display data if there is no q/query in an if-else statement?