Replies: 2 comments
-
To edit your vote click hide results and you should be able to change vote. |
Beta Was this translation helpful? Give feedback.
0 replies
-
i have a question, does the ─────────────────────── App Running ────────────────────────
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
event - compiled client and server successfully in 1091 ms (757 modules)
wait - compiling...
event - compiled client and server successfully in 159 ms (757 modules)
wait - compiling / (client and server)...
event - compiled client and server successfully in 353 ms (901 modules)
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/ramsy/.local/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 419, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "/home/ramsy/.local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
return await self.app(scope, receive, send)
File "/home/ramsy/.local/lib/python3.10/site-packages/fastapi/applications.py", line 270, in __call__
await super().__call__(scope, receive, send)
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/applications.py", line 124, in __call__
await self.middleware_stack(scope, receive, send)
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
raise exc
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
await self.app(scope, receive, _send)
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 92, in __call__
await self.simple_response(scope, receive, send, request_headers=headers)
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 147, in simple_response
await self.app(scope, receive, send)
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
raise exc
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
await self.app(scope, receive, sender)
File "/home/ramsy/.local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
raise e
File "/home/ramsy/.local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/routing.py", line 706, in __call__
await route.handle(scope, receive, send)
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
await self.app(scope, receive, send)
File "/home/ramsy/.local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
response = await func(request)
File "/home/ramsy/.local/lib/python3.10/site-packages/fastapi/routing.py", line 235, in app
raw_response = await run_endpoint_function(
File "/home/ramsy/.local/lib/python3.10/site-packages/fastapi/routing.py", line 161, in run_endpoint_function
return await dependant.call(**values)
File "/home/ramsy/.local/lib/python3.10/site-packages/pynecone/app.py", line 499, in upload_file
or types._issubclass(v, UploadFile)
File "/home/ramsy/.local/lib/python3.10/site-packages/pynecone/utils/types.py", line 113, in _issubclass
return cls_check_base == Any or issubclass(cls_base, cls_check_base)
TypeError: issubclass() arg 1 must be a class i did try to do Edit: I did make an issue #794 on this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The state code (common for all examples)
The render code - options ranked in order of increasing magic, decreasing explicitness.
Here we have the
multiple=True
prop, which allows multiple file uploads. Then thehandle_upload
event handler will receive alist[pc.UploadFile]
. If the prop is set to false, the argument will just be a singlepc.UploadFile
. (We can also make this always be a list if people prefer).Option 1:
Specify a function
pc.upload_files
that takes in as argumentsWe can also directly upload the file without a button (this applies for all the options):
Option 2:
Call the event handler directly in the lambda, and pass in an argument.
Option 3:
The same as Option 2, but we magically convert the string
"upload1"
into apc.UploadFile
object. This is shorter, but can be potentially confusing.Option 4:
In this option, we don't specify a name when uploading -
pc.upload_files()
function will upload all the files as a dict.17 votes ·
Beta Was this translation helpful? Give feedback.
All reactions