コード例 #1
0
def ajax_go_off_duty(request):
    assert request.GET, "Error: no get data"
    duty = Duty.latest_open(user=request.display_user)
    assert duty, "No open Duty"
    ret = {}

    #---------

    duty.end = atd(request.GET['timestamp'])
    duty.save()

    ret['duty'] = duty.as_json_dict()

    return ret
コード例 #2
0
ファイル: views.py プロジェクト: bovine/flightloggin2
def ajax_go_off_duty(request):
    assert request.GET, "Error: no get data"
    duty = Duty.latest_open(user=request.display_user)
    assert duty, "No open Duty"
    ret = {}
    
    #---------
      
    duty.end = atd(request.GET['timestamp'])
    duty.save()
    
    ret['duty'] = duty.as_json_dict()
    
    return ret
コード例 #3
0
ファイル: views.py プロジェクト: bovine/flightloggin2
def ajax_go_on_duty(request):
    assert request.GET, "Error: no get data"
    ret = {}
    
    #---------

    duty = Duty.latest_open(user=request.display_user) or \
           Duty(user=request.display_user)
           
    duty.start = atd(request.GET['timestamp'])
    duty.save()
    
    #if not duty.latest_open_block():
    #    block = Block(duty=duty)
    #    block.save()
    #    ret['block_id'] = block.id
        
    ret['duty'] = duty.as_json_dict()
    
    return ret
コード例 #4
0
def ajax_go_on_duty(request):
    assert request.GET, "Error: no get data"
    ret = {}

    #---------

    duty = Duty.latest_open(user=request.display_user) or \
           Duty(user=request.display_user)

    duty.start = atd(request.GET['timestamp'])
    duty.save()

    #if not duty.latest_open_block():
    #    block = Block(duty=duty)
    #    block.save()
    #    ret['block_id'] = block.id

    ret['duty'] = duty.as_json_dict()

    return ret