I come across this syntax on stackoverflow
from itertools import chain
result_list = list(chain(page_list, article_list, post_list))
I need to concatenate a bunch of QuerySets with something like this:
prjExpList = list(chain(lvl for lvl in prjlvl))
prjEnvList = list(chain(env for env in prjEnv))
This gives me an error of
AttributeError: 'QuerySet' object has no attribute '_meta'
My goal is to concatenate a bunch of QuerySets that's stored inside a list prjlvl and prjEnv
How do I do that?
list(chain(prjlvl, prjEnv))