Esempio n. 1
0
def process(request):
    struct = get_struct(request).exports
    if request.method == 'POST':
        rf = DatepickForm(request.POST)
        rf.fields['method'].choices = struct.EXPORTS(DATEPICK_PRESENTATION)
        if rf.is_valid():
            s = int(rf.cleaned_data['method'])
            if s == 0:
                from p24ip.arch.sopmods import excel
                return excel.process(request, rf.cleaned_data['dfrom'],
                                     rf.cleaned_data['dto'])
            if s == 1:
                from p24ip.arch.sopmods import extrema
                return extrema.process(request, rf.cleaned_data['dfrom'],
                                       rf.cleaned_data['dto'])
            else:
                return struct.__dict__['export' + str(s)](
                    request, rf.cleaned_data['dfrom'], rf.cleaned_data['dto'])

    else:
        rf = DatepickForm()
        rf.fields['method'].choices = struct.EXPORTS(DATEPICK_PRESENTATION)
    return render_to_response('arch/export_datepick.html', {
        'request': request,
        'form': rf
    })
Esempio n. 2
0
def process(request):
    dev = Device.objects.get(id=request.session['Device.id'])
    xd = p24.Device(dev.dev_number)
    struct = get_struct(request)
    af = AFDevice(dev.dev_number)
    return render_to_response('device/overview.html', {'dev':dev,'request':request,
                                                       'vendor':xd.vendor,
                                                       'struct':struct,
                                                       'af':af})
    
    
Esempio n. 3
0
def process(request):
    dev = Device.objects.get(id=request.session['Device.id'])
    xd = p24.Device(dev.dev_number)
    struct = get_struct(request)
    af = AFDevice(dev.dev_number)
    return render_to_response(
        'device/overview.html', {
            'dev': dev,
            'request': request,
            'vendor': xd.vendor,
            'struct': struct,
            'af': af
        })
Esempio n. 4
0
def process(request):
    struct = get_struct(request).exports
    if request.method == 'POST':
        rf = DatepickForm(request.POST)
        rf.fields['method'].choices = struct.EXPORTS(DATEPICK_PRESENTATION)
        if rf.is_valid():
            s = int(rf.cleaned_data['method'])
            if s == 0:
                from p24ip.arch.sopmods import excel
                return excel.process(request, rf.cleaned_data['dfrom'], rf.cleaned_data['dto'])
            if s == 1:
                from p24ip.arch.sopmods import extrema
                return extrema.process(request, rf.cleaned_data['dfrom'], rf.cleaned_data['dto'])
            else:
                return struct.__dict__['export'+str(s)](request, rf.cleaned_data['dfrom'], rf.cleaned_data['dto'])
            
    else:
        rf = DatepickForm()
        rf.fields['method'].choices = struct.EXPORTS(DATEPICK_PRESENTATION)
    return render_to_response('arch/export_datepick.html', {'request':request, 'form':rf})
Esempio n. 5
0
def control(request, site_name):
    from p24ip.manage import get_struct
    return get_struct(request).web.__dict__[site_name](request)
Esempio n. 6
0
def control(request, site_name):
    from p24ip.manage import get_struct    
    return get_struct(request).web.__dict__[site_name](request)