コード例 #1
0
ファイル: views.py プロジェクト: parkgyoungin/crm
def detailCompany(request, id):
    model = Company

    object = model.objects.get(id=id)
    view(object)
    security = object.security
    internal = object.internal
    virus = object.virus
    ransomware = object.ransomware

    pre_obj, next_obj = get_side_obj(request, id, model=model.__name__)

    uri = reverse('post:list', args=[model.__name__])
    if request.session[settings.LIST_CONDITIONS_ID].get(model.__name__):
        uri = config_page_uri(request, id, model.__name__, PAGE)

    content = {
        'object': object,
        'security': security,
        'internal': internal,
        'virus': virus,
        'ransomware': ransomware,
        'pre_obj': pre_obj,
        'next_obj': next_obj,
        'uri': uri,
    }

    return render(request, 'post/company/detail.html', content)
コード例 #2
0
ファイル: views.py プロジェクト: parkgyoungin/crm
def detailAnswer(request, id):
    object = Answer.objects.get(id=id)
    model = object.content_type.model_class()
    view(object)
    uri = reverse('post:list', args=[model.__name__])
    if request.session[settings.LIST_CONDITIONS_ID].get(model.__name__):
        uri = config_page_uri(request, object.object_id, model.__name__, PAGE)

    return render(request, 'post/answer/detail.html', {
        'object': object,
        'uri': uri
    })
コード例 #3
0
ファイル: views.py プロジェクト: parkgyoungin/crm
def detailDetectionpattern(request, id):
    model = DetectionPattern

    object = model.objects.get(id=id)
    view(object)
    pre_obj, next_obj = get_side_obj(request, id, model=model.__name__)
    comment = Comment.objects.filter(model_name=model.__name__, model_pk=id)

    uri = reverse('post:list', args=[model.__name__])
    if request.session[settings.LIST_CONDITIONS_ID].get(model.__name__):
        uri = config_page_uri(request, id, model.__name__, PAGE)

    content = {
        'object': object,
        'pre_obj': pre_obj,
        'next_obj': next_obj,
        'comment': comment,
        'uri': uri,
    }

    return render(request, 'post/detectionpattern/detail.html', content)