Replies: 3 comments 7 replies
-
Thanks for these forms. I will add them to the unit tests, asap. Please note, that yesterday I found a bug on the client side, when aggregating data on a root collection with siblings. This has been fixed in version 0.13.3. |
Beta Was this translation helpful? Give feedback.
-
You have a bug in class class TeamCollection(FormCollection):
…
def model_to_dict(self, company):
data = []
fields = self.declared_holders['team']._meta.fields
for team in company.teams.all():
data.append({
'team': model_to_dict(team, fields=fields),
'members': self.declared_holders['members'].model_to_dict(team),
})
return data
… |
Beta Was this translation helpful? Give feedback.
-
@gumish I just added two extra views, they are named The latter one can be used to edit multiple companies at once. Please note that you have to check out branch https://github.com/jrief/django-formset/tree/issue_37 in order to test this. |
Beta Was this translation helpful? Give feedback.
-
Hello,
at first I would like to thank you for the awesome work. The formsets in vanilla Django have been always disaster for me.
Could you please write me some example how to use Nested Collection with related Model (for example 3 levels)?
When I write it due to examples here ..
https://django-formset.readthedocs.io/en/latest/collections.html#nested-collection
https://django-formset.readthedocs.io/en/latest/model-collections.html#
.. it works only with the top level. But not with lower levels.
I have not found any example also here..
https://github.com/jrief/django-formset/tree/main/testapp/forms
I am not sure about the sentence:
The model_to_dict() in the 2nd level is not even started.
Simple FormModels:
Beta Was this translation helpful? Give feedback.
All reactions