#How do you call a function from a sub file in python

12 messages · Page 1 of 1 (latest)

fickle yacht
#

I'm trying to query data from a function.

here is my python query
projectsPerUser = client.query("plans.queries:getAllUserPlansWithUserId",{"userId": "user_2gQVIas5FGv9KaLZYCBrVWuXq7Z"})

Attached a photo of my folder structure and get this error. Don't think my above code is right, or is this possible to do in python?

#

How do you call a function from a sub file in python

tacit star
#

Yep the syntax is different @fickle yacht, it's "plans/queries:getAll..."

fickle yacht
#

Ah I was missing the / 😭

#

Thank you Tom!!

#

Live saver

tacit star
#

we should add an error message helper that notices this and put an example in the docstring

fickle yacht
#

Yeah I couldn’t find it anywhere for that case

#

now im getting a validation error 😅 , in typescript I just do an as Id<"users"> or something. do i need to do that with python too?

crude pumice
#

i don't think that user id is a valid v.id("users"), which would refer to the _id field of the users table and is generated by convex. what is the type of the userId field on plans?