Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
8107 Visninger

e.g.


computation.py

------------------------

class A(object):

def hell(self, number)

{

----

}



b = A()




-----------------------------


sale module

sale.py


class sale_order(models.Model):

def abc(self):

# Here i wants to use that method hello() How can i use it?

Avatar
Kassér
Bedste svar

Hi Irfankhan,

You can put computation.py file in the same folder in which sale.py file is placed and You can do following code in the sale.py.

from . import computation

and you can make object of class A in the following way:

b = computation.A()

and you can call method as follow:

b.hell(13)

Regards,

Hardik

Avatar
Kassér
Bedste svar

You have to import hello()

from computation import hello

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
jul. 25
465
1
jun. 25
1067
0
maj 25
1186
2
apr. 25
3179
1
feb. 25
1410