本文整理汇总了Python中forms.UploadFileForm.my_save方法的典型用法代码示例。如果您正苦于以下问题:Python UploadFileForm.my_save方法的具体用法?Python UploadFileForm.my_save怎么用?Python UploadFileForm.my_save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forms.UploadFileForm
的用法示例。
在下文中一共展示了UploadFileForm.my_save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: home
# 需要导入模块: from forms import UploadFileForm [as 别名]
# 或者: from forms.UploadFileForm import my_save [as 别名]
def home(request):
form = UploadFileForm(request.POST or None, request.FILES or None)
if form.is_valid():
form.my_save(request)
return redirect('/')
else:
return render(request, "index.html", {"form": form})
# @login_required()
# def userfiles(request):
# files = DropObjet.objects.filter(user=request.user)
# #files = DropObjet.objects.all()
# for file in files:
# print file.name
# return render(request, "userfiles.html", {'files': files})
#
# @login_required()
# def show_file(request):
# name = request.GET.get('name')
# #name = name.replace('_', ' ')
# print name
# print 'Good'
# file = get_object_or_404(DropObjet, name=name, user=request.user)
# client = dropbox.client.DropboxClient(settings.AUTH_TOKEN)
# shared_url = client.share(file.get_path(), short_url=True)
# print shared_url['url']
# return render(request, "show_file.html", {'link': shared_url['url']})