def sel_min(self):
"""
Take maximum id for current level
:return: None
"""
# TODO: rewrite for use in multi tree structure
query = Chain.select(fn.min(Chain.id)).where(Chain.id_parent == self.id_level)
for c in Chain.select().where(Chain.id_parent == self.id_level).order_by(Chain.id.asc()):
res = c.id
return res