Self not defined error

I am trying to follow an example but have made a few changes and now I get this error.I have been battling with creating this navigation module and getting it to work for some time now.
Any assistance will be greatly appreciated
Ps.I am new to all of this (If thats not clear already!)

from .import navigation
class Homeform(HomeformTemplate):          # line 13
  
  
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)

    # Any code you write here will run when the form opens.
  navigation.home_form = self                        # line 21
  navigation.go_home() 

NameError: name ‘self’ is not defined at [Homeform, line 21](javascript:void(0)) called from [Homeform, line 13](javascript:void(0))

Thanks in advance
Wayne

In Python, indentation is important. Your lines 21 and 22 need another level of indent so they are executing inside the init function (where the self parameter is defined).

1 Like

thanks so much
appreciate your help

1 Like