예제 #1
0
def taokeapi_manager_remove(request):
    ''' 淘客api管理--删除 '''
    taokeId = request.POST.get('id',None)
    
    if taokeId is not None:
        taokeapi = TaobaoApiDetail(id=taokeId)
        taokeapi.delete()
        
    return HttpResponseRedirect('/admin/taokeapi_manager')
예제 #2
0
def taokeapi_manager_remove(request):
    ''' 淘客api管理--删除 '''
    taokeId = request.POST.get('id', None)

    if taokeId is not None:
        taokeapi = TaobaoApiDetail(id=taokeId)
        taokeapi.delete()

    return HttpResponseRedirect('/admin/taokeapi_manager')
예제 #3
0
def taokeapi_manager(request):
    ''' 淘客api管理 '''
    form = None
    taokeapi_list = TaobaoApiDetail.objects.order_by('id')
    
    if request.method == 'POST' :
        form = TaobaoApiDetailForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            taokeapi = TaobaoApiDetail(appKey=cd['appKey'],
                                       appSecret=cd['appSecret'])
            
            taokeapi.save()
            
            return HttpResponseRedirect('/admin/taokeapi_manager')
    
    if form is None:
        form = TaobaoApiDetailForm()
    
    dict = {'taokeapi_list':taokeapi_list,'form':form}
    
    return render_to_response('admin/templates/admin_taokeapi_manager.html',dict)
예제 #4
0
def taokeapi_manager(request):
    ''' 淘客api管理 '''
    form = None
    taokeapi_list = TaobaoApiDetail.objects.order_by('id')

    if request.method == 'POST':
        form = TaobaoApiDetailForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            taokeapi = TaobaoApiDetail(appKey=cd['appKey'],
                                       appSecret=cd['appSecret'])

            taokeapi.save()

            return HttpResponseRedirect('/admin/taokeapi_manager')

    if form is None:
        form = TaobaoApiDetailForm()

    dict = {'taokeapi_list': taokeapi_list, 'form': form}

    return render_to_response('admin/templates/admin_taokeapi_manager.html',
                              dict)
예제 #5
0
def apps_manager(request):

    form = None
    if request.method == 'POST':
        form = AppsManagerEditForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            app = App(
                name=cd['name'],
                detail=cd['detail'],
                taokeAccount=TaokeAccount(id=cd['taokeAccount']),
                taobaoApiDetail=TaobaoApiDetail(id=cd['taobaoApiDetail']))
            app.save()

            return HttpResponseRedirect('/admin/apps_manager')

    app_list = App.objects.order_by('id')
    if form is None:
        form = AppsManagerEditForm()

    dict = {'app_list': app_list, 'form': form}
    return render_to_response('admin/templates/admin_apps_manager.html', dict)