예제 #1
-1
파일: views.py 프로젝트: reorx/PIGS
def know_write_modify(req, nid=None, tpl='know/know_write_modify.html'):
    qs = know_QS.know(nid)
    print qs
    print dir(qs)
    print qs.brief
    if qs is None:
        raise Http404
    if 'GET' == req.method:
        cdic = dict(
            form = KnowForm(instance=qs),
            form_ins = qs
        )
        return render_tpl(req, tpl, cdic)
    return HttpResponse('405 method error')
예제 #2
-1
파일: views.py 프로젝트: reorx/PIGS
def know_read(req, nid=None, tpl='know/know.html'):
    """
    preparing rules for api:
        when GET, args are:
            - nid - with_child    (0, 1)
            - data_type          'json','html'[default]
            - c_id
        well, POST not allow
    """
    qs = know_QS.know(nid)
    if qs is None:
        raise Http404
    cdic = dict(
        know = qs
    )
    return render_tpl(req, tpl, cdic)