def lend_thing(username, thing_id, to_user):

    try:
        thing = Thing.get(thing_id)
    except ResourceNotFound:
        print 'Thing not found'
        return

    lending = Lending(thing=thing_id, owner=username, to_user=to_user)
    lending.save()

    print lending, 'saved with _id', lending._id