Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check_empty(data, model, id):
- res = []
- if not data or (data[0].id == id and len(data) == 1):
- res = model.objects.values_list('id', flat=True)
- else:
- for c in data:
- res += c.get_self_and_childrens_ids()
- #res = list(set(res))
- return res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement