Hi I'm new with django and python.
# function for fecthing the child
def get_childern(request, username):
Q = list(Profile.objects.filter(sponsor_id__exact=username))
populate(request, Q, username)
# Iterate the Queryset
def populate(request, quesryset, username):
if quesryset:
messages.success(request, username+' has '+str(len(quesryset))+' child')
messages.info(request, quesryset)
for user in quesryset:
get_childern(request, user.user_id)
else:
messages.warning(request, 'User '+username+' has no child')
return False
# calling all children
get_childern(request, username)
and I want to add the level, how to break it down further.
Please help me, invest lots of time and mind. Thanks to all :)