def get_profile_for_user(user):
 if (not hasattr(user, u'_mezzanine_profile')):
  profile_model = get_profile_model()
  profile_manager = profile_model._default_manager.using(user._state.db)
  user_field = get_profile_user_fieldname(profile_model, user.__class__)
  (profile, created) = profile_manager.get_or_create(**{user_field: user})
  profile.user = user
  user._mezzanine_profile = profile
 return user._mezzanine_profile

def get_profile_for_user ( user ) : if ( not hasattr ( user , u'_mezzanine_profile' ) ) : profile_model = get_profile_model ( ) profile_manager = profile_model . _default_manager . using ( user . _state . db ) user_field = get_profile_user_fieldname ( profile_model , user . __class__ ) ( profile , created ) = profile_manager . get_or_create ( ** { user_field : user } ) profile . user = user user . _mezzanine_profile = profile return user . _mezzanine_profile
returns site-specific profile for this user .