Example #1
0
def material_list(request, template='material/material_list.html'):
    """
    material_list list page
    """
    wallingmaterial_list = WallingMaterial.objects.all()
    fields = (("name", "name", ""), 
              ("cost", "cost by m^3", ""),
              ("volume", _("Volume m^3"), ""), )
    wallingmaterial_table = AjaxTable(wallingmaterial_list, fields)
    armature_list = Armature.objects.all()
    fields = (("name", "name", ""), 
              ("cost", "cost by T", ""),
              ("diameter", _("Diameter mm"), ""), )
    armature_table = AjaxTable(armature_list, fields)
    context = RequestContext(request, {"wallingmaterial_table": wallingmaterial_table.render(request),
                                       "armature_table": armature_table.render(request), })
    return render_to_response(template, context)
Example #2
0
def wall_type_list(request, template='wall/walltype_list.html'):
    """
    walltype list page
    """
    walltype_list = WallType.objects.all()
    fields = (("name", "name", ""), 
              ("cost", "cost by m^2", ""), )
    table = AjaxTable(walltype_list, fields)
    context = RequestContext(request, {"walltype_table": table.render(request), })
    return render_to_response(template, context)
Example #3
0
def project(request, project_slug, template='core/project.html'):
    building = get_object_or_404(Building, slug=project_slug)
    fields = (("name", "name", ""),
              ("height", "height", ""),
              ("square", "square", "")
               )
    floor_table = AjaxTable(building.floors.all(), fields,'core/project_table.html' )
    context = RequestContext(request, {"building": building,
                                       "floor_table": floor_table.render(request),})
    return render_to_response(template, context)
Example #4
0
def home(request, template='core/index.html'):
    """
    Home page
    """
    building_list = Building.objects.all()
    fields = (("name", "name", ""),
              ("width", "width", ""),
              ("length", "length", ""),
              ("square", "square", ""), )
    table = AjaxTable(building_list, fields,'core/project_table.html' )
    context = RequestContext(request, {"building_table": table.render(request), })
    return render_to_response(template, context)