I would like to set up a radio select option in admin for my blog's category. ManyToMany fields do not work with a RadioSelect widget.
I want the category to be a ManyToOne relationship with the articles. Right now I have a ParentalManyToMany field and I register the snippet for the blog category.
class BlogPage(Page):
...
category = ParentalManyToManyField('blog.ArticleCategory', blank=True)
...
@register_snippet
class ArticleCategory(models.Model):
name = models.CharField(max_length=255)
slug = models.SlugField(unique=True, max_length=80)
panels = [
FieldPanel('name'),
FieldPanel('slug'),
]
def __str__(self):
return self.name
I don't know how to change this into a ManyToOne option, so I could have a radioselect instead of a CheckboxSelectMultiple.
Help would be appreciated. Thanks!