예제 #1
0
def view_all(request, model_name):
    """
    Create a view listing out all of the models
    :param request:
    :param model_name:
    :return:
    """
    if model_name in model_views.view_methods:
        return model_views.view_all_methods[model_name](request)
    else:
        return render_chaffers(request, 'django_model_table.html',
                               {'model_name': model_name})
예제 #2
0
파일: views.py 프로젝트: angusm/chaffers
def view_all(request, model_name):
    """
    Create a view listing out all of the models
    :param request:
    :param model_name:
    :return:
    """
    if model_name in model_views.view_methods:
        return model_views.view_all_methods[model_name](request)
    else:
        return render_chaffers(
            request,
            'django_model_table.html',
            {'model_name': model_name}
        )
예제 #3
0
def view(request, model_name, model_id):
    """
    Create a view showing information about the given model
    :param request:
    :param model_name:
    :param model_id:
    :return:
    """
    if model_name in model_views.view_methods:
        return model_views.view_methods[model_name](request, model_id)
    else:
        return render_chaffers(request, 'django_model_view.html', {
            'model_name': model_name,
            'model_id': model_id
        })
예제 #4
0
파일: views.py 프로젝트: angusm/chaffers
def view(request, model_name, model_id):
    """
    Create a view showing information about the given model
    :param request:
    :param model_name:
    :param model_id:
    :return:
    """
    if model_name in model_views.view_methods:
        return model_views.view_methods[model_name](request, model_id)
    else:
        return render_chaffers(
            request,
            'django_model_view.html',
            {
                'model_name': model_name,
                'model_id': model_id
            }
        )