All pastes #562937 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-12 23:24 UTC
rendered paste body
    for u in users:
        print "Adding friends for user: %s" % (u['username'])
        user_from = model.User.get_by(username=u['username'])
        for x in users:
            if x['username'] != u['username']:
                print "Added friend: %s" % (x['username'])
                user_to = model.User.get_by(username=x['username'])
                from_invite = model.Friend(user_from=user_from, user_to=user_to, inviter=True, created_by=user_to.id)
                to_invite = model.Friend(user_from=user_to, user_to=user_from, inviter=False, created_by=user_from.id)
                model.ctx.current.flush()