Exemple #1
0
def save_users(names, group=None):
    members, users = [], []
    if group:
        members = group.members
        users = get_users(group)
    for name in names:
        for user in users:
            if name == user.name:
                break
        else:
            user = UserAlias(name=name)
            user.put()
            members.append(user.key().id())

    return members
Exemple #2
0
def get_user(id):
    try:
        return UserAlias.get_by_id(long(id))
    except:
        return None
Exemple #3
0
def get_users(group):
    users = []
    for member_id in group.members:
        users.append(UserAlias.get_by_id(member_id))
    return users