Don't model it like this :).
Seriously, do something like this:
class FriendShip(db.Model):
account_id = db.IntegerProperty() # Sure use refprop if you want, waste of space IMHO
Then create it like this:
friendship = FiendShip(parent=db.Key.from_path('User', USER_1_ID, 'Friend', USER_2_ID), account_id=USER_2_ID)
# Then make another one under the other guy:
friendship_sym = FiendShip(parent=db.Key.from_path('User', USER_2_ID, 'Friend', USER_1_ID), account_id=USER_1_ID)
db.put([friendship, friendship_sym])
That does this do?
* Testing for friendship: db.get(db.Key.from_path('User', USER_1_ID, 'Friend', USER_2_ID)) -- if not None they are friends.
* Friends of user one? FriendShip.all(ancestor=db.Key.from_path('User', USER_1_ID)) # Note--this is always consistent! Woohoo!
* Everyone that is friends with user 2? FriendShip.all().filter('account_id', USER_2_ID) # Not always consistent, but pretty close :)
-Jesse