Example #1
0
def lager_info(request):
    """View für die Lager-Informations-Ansicht"""
    
    kerneladapter = Kerneladapter()
    anzahl_artikel = len(kerneladapter.get_article_list())
    booked, unbooked = _get_locations_by_height()
    booked = sorted((height, len(loc)) for height, loc in booked.items())
    unbooked = sorted((height, len(loc)) for height, loc in unbooked.items())
    
    num_booked = sum(platz[1] for platz in booked)
    num_unbooked = sum(platz[1] for x in unbooked)
    
    ctx = {'anzahl_bebucht': num_booked,
           'anzahl_unbebucht': num_unbooked,
           'anzahl_plaetze': num_booked + num_unbooked,
           'anzahl_artikel': anzahl_artikel,
           'plaetze_bebucht': booked,
           'plaetze_unbebucht': unbooked
          }
    
    extra_info = kerneladapter.get_statistics()
    extra_info['oldest_movement'] = fix_timestamp(extra_info['oldest_movement'])
    extra_info['oldest_pick'] = fix_timestamp(extra_info['oldest_pick'])
    ctx.update(extra_info)
    return render_to_response('myplfrontend/lager_info.html', ctx, context_instance=RequestContext(request))