def current_user_info(request): """ 获得当前用户的信息。 :param request: :return: """ if not_login(request): return http_to_json(None) return http_to_json(request.user.profile)
def current_user(request): """ 获得当前用户的用户名。 :param request: :return: """ if not_login(request): return http_to_json(None) return http_to_json(request.user.username)
def show_identity_choices(request): """ 显示所有的用户身份选项。 :param request: :return: """ return http_to_json(database_identity_choices())
def get_user_special_permissions(request, username): """ 获得用户所有的特殊权限。 :param request: :param username: 用户名 :return: """ return http_to_json(database_spacial_permission_all(username))
def get_user_identity(request, username): """ 获得用户的身份信息。 :param request: :param username: 用户名 :return: """ return http_to_json(database_user_identity(username))
def get_user_info(request, username): """ 获得指定用户的信息。 :param request: :param username: 用户名 :return: """ return http_to_json(database_get_user(username=username))
def get_user_followers(request, username, start, end): """ 获得关注用户的所有用户信息。 :param request: :param username: :param start: :param end: :return: """ return http_to_json(database_user_followers(username, start, end))
def search_user_nickname(request, nickname, start, end): """ 按照昵称搜索用户。 :param request: :param nickname: :param start: :param end: :return: """ return http_to_json( database_search_user(username=nickname, start=start, end=end))
def search_user_username(request, username, start, end): """ 按照用户名搜索用户。 :param request: :param username: :param start: :param end: :return: """ return http_to_json( database_search_user(username=username, start=start, end=end))