Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3246 Zobrazení

Hello i have a question about checking records if the have children records

Avatar
Zrušit

elaborate your query

Nejlepší odpověď

Hi,

This how you can do:

child_ids = self.search([('parent_id','=',self.id)])
if child_ids:
     return True
else:
     return False
Avatar
Zrušit