Пример #1
0
def save_profile(first_name, last_name, email, password, interests, friends,
                 city, state):
    p = helper.get_user_profile(email)
    if p:
        p.first_name = first_name
        p.last_name = last_name
        p.email = email
        p.password = password
        p.interests = interests
        p.friends = friends
        p.city = city
        p.state = state
    else:
        p = UserProfile(first_name=first_name,
                        last_name=last_name,
                        email=email,
                        password=password,
                        interests=interests,
                        friends=friends,
                        city=city,
                        state=state)
    p.put()
Пример #2
0
def get_recent_profiles():
    q = UserProfile.query().order(-UserProfile.last_update)
    return q.fetch(50)
Пример #3
0
def get_profile_by_first_name(name):
    q = UserProfile.query(UserProfile.first_name == name)
    results = q.fetch(1)
    for profile in results:
        return profile
    return None
Пример #4
0
def get_user_friends(email):
    q = UserProfile.query(UserProfile.email == email)
    results = q.fetch(1)
    for profile in results:
        return profile.friends
Пример #5
0
def get_user_check_box_values(email):
    q = UserProfile.query(UserProfile.email == email)
    results = q.fetch(1)
    for profile in results:
        return profile.check_box_valies
Пример #6
0
def get_user_interest(email):
    q = UserProfile.query(UserProfile.email == email)
    results = q.fetch(1)
    for profile in results:
        return profile.interest
Пример #7
0
def get_user_last_name(email):
    q = UserProfile.query(UserProfile.email == email)
    results = q.fetch(1)
    for profile in results:
        return profile.last_name