コード例 #1
0
ファイル: manager.py プロジェクト: gdjet/gdjet
def modules( request, basetemplate = 'gdjet/manager/base.html', 
             template = 'gdjet/manager/manager.html',
             message = "" ):
    t = loader.get_template( template )
    m = ManagerModule.objects.all()
    c = RequestContext(request,
    {
        'basetemplate': basetemplate, # use your own here.
        'message': message,
        'modules': m,
    })
    return HttpResponse( t.render(c) )
コード例 #2
0
ファイル: manager.py プロジェクト: gdjet/gdjet
def amodule( request, name, template = 'gdjet/manager/amodule.html',
             message = "" ):
    t = loader.get_template( template )
    try:
        m = ManagerModule.objects.get( name__exact = name)
    except ManagerModule.DoesNotExist:
        message = "Module %s does not exist" % name
        m = None
    c = RequestContext(request, {
        'message': message,
        'modul': m,
    })
    return HttpResponse( t.render(c) )