Hello,
I have several models with one-to-one relation. For example
class Task(models.Model):
initial_comment = models.OneToOneField('Comment')
# A pack of other fields
class Comment(models.Model)
body = RichTextField()
# A pack of other fields
I want to create "create view" based on form, that gives user ability to create task and initial comment there.
1) I can't use CreateView because it is based on only one model
2) I can't use ModelForm because it is based on only one model
3) I can create several forms, but I can't join them into one formset (forms are different)
4) I feel "inlineformset_factory" (InlineFormSet) should be used here, but I am not sure it suits best. Is there any 3rd party Django app to do that?
Sure I can create form myself, but I do not want to copy/paste all fields, their types, localized labels, validations and so on. I just want to list their names (like "fields" attibute).
If you wonder why do I need one-to-one: Comments are used heavily in other places and have different relations with different models.
Thank you.
Ilya.