How do I reference variables passed with an open_form(Form, argument) on the newly opened form

How do I reference variables passed with an open_form(Form, argument) on the newly opened form?

form = Form2()
open_form(form, "some string")

How do I assign “some string” to a variable now when the form opens, or how do I reference it, if its indexed somewhere?

You need to add the passed in variable as a parameter to Form2’s init method:

def __init__ (self, some_string, **properties):

Then just use some_string like any other variable.

2 Likes

4 posts were split to a new topic: open_form() doesn’t work with positional arguments