Example #1
0
def get_all_users(provider_key_id=None):
    ancestor_key = ndb.Key(urlsafe=provider_key_id) if provider_key_id else None

    users = UserModel.query(ancestor=ancestor_key).fetch()
    return users
Example #2
0
def get_users_by_username(username, provider_key_id=None):
    ancestor_key = ndb.Key(urlsafe=provider_key_id) if provider_key_id else None

    users = UserModel.query(ancestor=ancestor_key).filter(UserModel.username == username)
    return users