I'm building a page where the users can choose which rows to edit. After they select their rows and hit "edit" I'd like to present them with a modelformset_factory showing an editable version of all the rows the user selected.
My problem is I believe I need to turn this list of primary keys that I get back into a queryset suitable for use with the modelformset_factory and I don't know how to do that.
I suppose I could "brute force" it by specifying an SQL statement like:
SELECT <cols> FROM <table> WHERE pk=val1 OR pk=val2 OR pk=val3 OR ... OR pk=valN
But that just seems ugly.
Is there a way I can manually create a queryset by adding a bunch of essentially unrelated rows (all from the same table)?