Unbound methods
i have this method in a class called 'orcamento':
def _verifica_
for orc in lista_orcs:
if orc.tipo_
for orclinha in orc_linhas_lista:
return True
in if statement i call function verifica_abate() from class sncp_orcamento_
verifica_
This function i call it with the database that corresponds to the sncp_orcamento_
I have this error:
unbound method verifica_abate() must be called with sncp_orcamento_
How can i create this instance to pass as argument of method verifica_abate()?
What i am doing wrong?
Can you help me?
Thanks,
José
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Alexandre Fayolle - camptocamp
- Solved:
- 2013-11-06
- Last query:
- 2013-11-06
- Last reply:
- 2013-11-06
verifica_abate is not a function, it is a class method. You need to call it from an instance of the sncp_orcamento_
This would give something like the following, assuming that sncp_orcamento_
add this at the begining of _verifica_
sncp_
replace "sncp_orcamento
Thanks. it solve my problem. :)