I need to run through db using recursion and get a list of results at the end. Function works correct (if print unrem) but I cann't return the list of results.
def find_locks(item, ids):
if item.video_id:
#print (item.video_id, ids)
return (item.video_id, ids)
for i in CatalogItem.objects.filter(parent=item):
if i.is_lock:
find_locks(i, ids.append(i.id))
else:
find_locks(i, ids)
How can I get the list results?