Reputation: 1639
Suppose I have this model :
class TaggedItem(models.Model):
tag = models.SlugField()
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
sub_type = models.CharField(choices=CHOICES)
and
CHOICES = [(a, A),(b, B), ...]
is there a way to exclude some choices depending on the ContentType involved ?
Upvotes: 0
Views: 113