Reputation: 2058
Suppose I have a table with the Column A and B.
I want to find out whether a particular field exists in Column A. I also want to know how many of them are there
Upvotes: 0
Views: 338
Reputation: 7244
Suppose you have a Model that looks like this:
class Employee(db.Model):
name = db.StringProperty()
You can query the existence of a particular value and/or the total number of entities which have that value in a property, you can query like so:
def jack_chan_in_employee():
query = Employee.all()
count = query.filter('name =', 'Jacky Chan').count()
return count
Upvotes: 1