Skip to content

Commit

Permalink
Update model-collections.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelJennings authored Jul 1, 2024
1 parent 0cf365e commit 0a3975e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/model-collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ the company, its departments and their teams as:
class DepartmentCollection(FormCollection):
min_siblings = 0
department = DepartmentForm()
teams = TeamCollection()
teams = TeamCollection() # attribute name MUST match related_name (see note below)
legend = "Departments"
add_label = "Add Department"
related_field = 'company'
Expand All @@ -242,7 +242,7 @@ the company, its departments and their teams as:

class CompanyCollection(FormCollection):
company = CompanyForm()
department_set = DepartmentCollection()
department_set = DepartmentCollection() # attribute name MUST match related_name (see note below)

As we expect, we see that every Django model is represented by its form. Since we want to edit more
instances of the same model type, we somehow need a way to distinguish them. This is where the form
Expand Down

0 comments on commit 0a3975e

Please sign in to comment.