Answer the question
In order to leave comments, you need to log in
Is it possible to fill each select with its own value in inlineformset?
Good afternoon, I do not know how to formulate the question correctly. Here I am displaying the form using inline formset
CategoryPriceFormSet = inlineformset_factory(
Performer,
CategoryPrice,
fields=('name', 'price'),
fk_name='performer',
extra=CATEGORY_COUNT,
max_num=CATEGORY_COUNT
)
# Модель
class CategoryPrice(models.Model):
performer = models.ForeignKey(
Performer,
on_delete=models.CASCADE,
)
name = models.ForeignKey(Category, on_delete=models.CASCADE, null=True)
price = models.CharField(max_length=64, blank=True, null=True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question