Exemple #1
0
def current_user_info(request):
    """
    获得当前用户的信息。
    :param request:
    :return:
    """
    if not_login(request):
        return http_to_json(None)
    return http_to_json(request.user.profile)
Exemple #2
0
def current_user(request):
    """
    获得当前用户的用户名。
    :param request:
    :return:
    """
    if not_login(request):
        return http_to_json(None)
    return http_to_json(request.user.username)
Exemple #3
0
def show_identity_choices(request):
    """
    显示所有的用户身份选项。
    :param request:
    :return:
    """
    return http_to_json(database_identity_choices())
Exemple #4
0
def get_user_special_permissions(request, username):
    """
    获得用户所有的特殊权限。
    :param request:
    :param username: 用户名
    :return:
    """
    return http_to_json(database_spacial_permission_all(username))
Exemple #5
0
def get_user_identity(request, username):
    """
    获得用户的身份信息。
    :param request:
    :param username: 用户名
    :return:
    """
    return http_to_json(database_user_identity(username))
Exemple #6
0
def get_user_info(request, username):
    """
    获得指定用户的信息。
    :param request:
    :param username: 用户名
    :return:
    """
    return http_to_json(database_get_user(username=username))
Exemple #7
0
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))
Exemple #8
0
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))
Exemple #9
0
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))