コード例 #1
0
ファイル: views.py プロジェクト: APSL/Adjax
def messages(request):
    """ Display some messages """
    adjax.success(request, "This is your first success")
    adjax.info(request, "This is your first info")
    adjax.warning(request, "This is your first warning")
    adjax.error(request, "This is your first error")
    adjax.debug(request, "This is your first debug")
    return adjax.response(request, include_messages=True)
コード例 #2
0
ファイル: views.py プロジェクト: APSL/Adjax
def do_everything(request):
    """ Putting everything together. """
    adjax.replace(request, '#abc', 'Hello world')
    adjax.hide(request, '#xyz')
    adjax.success(request, "This is your first success")
    adjax.info(request, "This is your first info")
    adjax.warning(request, "This is your first warning")
    adjax.error(request, "This is your first error")
    adjax.debug(request, "This is your first debug")
    my_obj = MyModel(name="Abc", color="blue", price=123)
    adjax.update(request, my_obj, ('name', 'color'))
    my_form = MyForm({'name': "ABC", 'price': 123}, prefix="withprefix")
    adjax.form(request, my_form)
    adjax.redirect(request, 'do_nothing')
    adjax.extra(request, 'two', 234)
    adjax.render_to_response(request, 'basic/_included.html', {'abc': 'xyz123'})
    adjax.render_to_response(request, 'basic/_included.html', {'abc': 'mno456'}, prefix="tree")
    return {'one': 123}