How to use Django QuerySet.union() in ModelAdmin.formfield_for_manytomany()?
问题 Not sure what I am doing wrong here: I tried to use QuerySet.union(), in Django 2.2.10, to combine two querysets (for the same model) inside ModelAdmin.formfield_for_manytomany() . However, when the form is saved, the entire queryset is selected, regardless of the actual selection made. Please consider the minimal example below, based on the standard Django Article/Publication example. from django.db import models from django.contrib import admin class Publication(models.Model): pass class