to keep my project clean I have module with my CalculationLogic class. I call this class in my views.py file, like:
def method_in_views_file(request):
cl = CalculationLogic()
return cl.method_in_calculation_logic()
In my CalculationLogic:
def other_function(self,x):
# some logic here #
return result
def method_in_calculation_logic(self,args):
# some logic here #
x = ['x','y','z']
data = other_function(x)
return render(request,'file.html',{'data':data})
Unfortunately after calling this view in my browser I get NameError that other function is not defined. Which part can be wrong here?