示例#1
0
def make_friendship(db, user1, user2):
    """
    Create a friendship between two users.

    The Friendship object created is added to the session.
    """
    db.add(users.Friendship(userid=user1.userid, otherid=user2.userid))
    db.flush()
示例#2
0
def create_friendship(user1, user2, settings=None):
    db = d.connect()
    db.add(users.Friendship(userid=user1, otherid=user2, settings=settings))
    db.flush()