File size: 3,812 Bytes
c7f4bd0 |
1 2 3 |
{"nwo":"Alem\/django-jfu","sha":"f45025f0a6d4cbc8d7f4933a77da8468cd296159","path":"jfu\/http.py","language":"python","identifier":"upload_receive","parameters":"( request )","argument_list":"","return_statement":"return request.FILES['files[]'] if request.FILES else None","docstring":"Returns the file(s) uploaded by the user.","docstring_summary":"Returns the file(s) uploaded by the user.","docstring_tokens":["Returns","the","file","(","s",")","uploaded","by","the","user","."],"function":"def upload_receive( request ):\n \"\"\"\n Returns the file(s) uploaded by the user.\n \"\"\"\n return request.FILES['files[]'] if request.FILES else None","function_tokens":["def","upload_receive","(","request",")",":","return","request",".","FILES","[","'files[]'","]","if","request",".","FILES","else","None"],"url":"https:\/\/github.com\/Alem\/django-jfu\/blob\/f45025f0a6d4cbc8d7f4933a77da8468cd296159\/jfu\/http.py#L5-L9"}
{"nwo":"Alem\/django-jfu","sha":"f45025f0a6d4cbc8d7f4933a77da8468cd296159","path":"jfu\/templatetags\/jfutags.py","language":"python","identifier":"jfu","parameters":"(\n context,\n template_name = 'jfu\/upload_form.html',\n upload_handler_name = 'jfu_upload',\n *args, **kwargs\n )","argument_list":"","return_statement":"return t.render( Context( context ) )","docstring":"Displays a form for uploading files using jQuery File Upload.\n\n A user may use both a custom template or a custom upload-handling URL\n name by supplying values for template_name and upload_handler_name\n respectively.\n\n Any additionally supplied positional and keyword arguments are directly\n forwarded to the named custom upload-handling URL.","docstring_summary":"Displays a form for uploading files using jQuery File Upload.","docstring_tokens":["Displays","a","form","for","uploading","files","using","jQuery","File","Upload","."],"function":"def jfu(\n context,\n template_name = 'jfu\/upload_form.html',\n upload_handler_name = 'jfu_upload',\n *args, **kwargs\n ):\n \"\"\"\n Displays a form for uploading files using jQuery File Upload.\n\n A user may use both a custom template or a custom upload-handling URL\n name by supplying values for template_name and upload_handler_name\n respectively.\n\n Any additionally supplied positional and keyword arguments are directly\n forwarded to the named custom upload-handling URL.\n \"\"\"\n context.update( { \n 'JQ_OPEN' : '{%',\n 'JQ_CLOSE' : '%}',\n 'upload_handler_url': reverse(\n upload_handler_name, args = args, kwargs = kwargs\n ),\n } )\n\n # Use the request context variable, injected\n # by django.core.context_processors.request,\n # to generate the CSRF token.\n context.update( csrf( context.get('request') ) )\n\n t = loader.get_template( template_name )\n\n return t.render( Context( context ) )","function_tokens":["def","jfu","(","context",",","template_name","=","'jfu\/upload_form.html'",",","upload_handler_name","=","'jfu_upload'",",","*","args",",","*","*","kwargs",")",":","context",".","update","(","{","'JQ_OPEN'",":","'{%'",",","'JQ_CLOSE'",":","'%}'",",","'upload_handler_url'",":","reverse","(","upload_handler_name",",","args","=","args",",","kwargs","=","kwargs",")",",","}",")","# Use the request context variable, injected","# by django.core.context_processors.request,","# to generate the CSRF token.","context",".","update","(","csrf","(","context",".","get","(","'request'",")",")",")","t","=","loader",".","get_template","(","template_name",")","return","t",".","render","(","Context","(","context",")",")"],"url":"https:\/\/github.com\/Alem\/django-jfu\/blob\/f45025f0a6d4cbc8d7f4933a77da8468cd296159\/jfu\/templatetags\/jfutags.py#L8-L39"}
|