There is a task to pass a variable to the Q object.
Request to the database:
data = Module.objects.filter(Q(plug_module='1') | Q(plug_module='2')) I consider 2 options 1) pass the variable select = "plug_module='1'" This variable is select = "plug_module='1'" to change. 2) send a completely ready request of type Q(plug_module='1') | Q(plug_module='2') Q(plug_module='1') | Q(plug_module='2') in Module.objects.filter()
per = "Q(plug_module='1') | Q(plug_module='2')" data = Module.objects.filter(per) Is it possible to do so or not? The point is to automatically generate QuerySet requests depending on the data coming from the web.