How can I restrict Django’s GenericForeignKey to a list of models?

For example, your apps are app and app2 and there are A, B models in app and there are C, D models in app2. you want to see only app.A and app.B and app2.C from django.db import models class TaggedItem(models.Model): tag = models.SlugField() limit = models.Q(app_label=”app”, model=”a”) | models.Q(app_label=”app”, model=”b”) | models.Q(app_label=”app2″, model=”c”) content_type = … Read more