开发者

How can I check if a particular value exists in a particular column in google app engine datastore?(python)

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


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜