hello so i have these two models:
class Medicine(models.Model):
medicine = models.CharField(max_length=150)
...
class Condition(models.Model):
patient = models.ForeignKey(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="conditions"
)
conditions = models.ForeignKey(
ConditionInfo, on_delete=models.CASCADE, related_name="conditions"
)
severity = models.CharField(max_length=100, blank=True, null=True)
medicines = models.ManyToManyField(
Medicine, related_name="conditions", null=True, blank=True
)
and this form:
class ConditionForm(ModelForm):
class Meta:
model = Condition
exclude = ("patient",)
so my question is
right now when i put this form in a html page for my users to fill in
the many to many field doesn’t allow users to input new data
they can only choose from pre-existing data
how can i set so users can do both choosing from existing data or input new ones if they want to