def taoke_manager_remove(request): ''' 淘客账号管理--删除 ''' taokeId = request.POST.get('id',None) if taokeId is not None: taoke = TaokeAccount(id=taokeId) taoke.delete() return HttpResponseRedirect('/admin/taoke_manager')
def taoke_manager_remove(request): ''' 淘客账号管理--删除 ''' taokeId = request.POST.get('id', None) if taokeId is not None: taoke = TaokeAccount(id=taokeId) taoke.delete() return HttpResponseRedirect('/admin/taoke_manager')
def taoke_manager(request): ''' 淘客账号管理 ''' form = None taoke_list = TaokeAccount.objects.order_by('id') if request.method == 'POST' : form = TaokeAccountForm(request.POST) if form.is_valid(): cd = form.cleaned_data taoke = TaokeAccount(taokeName=cd['taokeName'], detail=cd['detail']) taoke.save() return HttpResponseRedirect('/admin/taoke_manager') if form is None: form = TaokeAccountForm() dict = {'taoke_list':taoke_list,'form':form} return render_to_response('admin/templates/admin_taoke_manager.html',dict)
def taoke_manager(request): ''' 淘客账号管理 ''' form = None taoke_list = TaokeAccount.objects.order_by('id') if request.method == 'POST': form = TaokeAccountForm(request.POST) if form.is_valid(): cd = form.cleaned_data taoke = TaokeAccount(taokeName=cd['taokeName'], detail=cd['detail']) taoke.save() return HttpResponseRedirect('/admin/taoke_manager') if form is None: form = TaokeAccountForm() dict = {'taoke_list': taoke_list, 'form': form} return render_to_response('admin/templates/admin_taoke_manager.html', dict)
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)