I have tags model:
class MediaTag(TagBase):
free_tagging = False
color = models.CharField(
_("Tag color"),
max_length=7,
choices=MEDIA_TAG_COLOR_CHOICES
)
site = models.ForeignKey(
'wagtailcore.Site',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)
class MediaTagItem(ItemBase):
tag = models.ForeignKey(
MediaTag, related_name="tagged_media", on_delete=models.CASCADE
)
content_object = ParentalKey(
'MediaPage',
on_delete=models.CASCADE,
related_name='tagged_items'
)
class MediaPage(AbstractNewsPage, index.Indexed):
tags = ClusterTaggableManager(through=MediaTagItem, blank=False)
...
I need to change MediaPage admin widget for the tags feild to select. And set options for it with tags for the same site as the page. I can change the widget using the register_form_field_override function, but how do I pass choises there?