Support validation for object fields using form_classes mapping#797
Open
JohananOppongAmoateng wants to merge 4 commits intodjango-commons:mainfrom
Open
Support validation for object fields using form_classes mapping#797JohananOppongAmoateng wants to merge 4 commits intodjango-commons:mainfrom
JohananOppongAmoateng wants to merge 4 commits intodjango-commons:mainfrom
Conversation
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
adamghill
reviewed
Feb 22, 2026
adamghill
reviewed
Feb 22, 2026
| else: | ||
| self.errors.update(form_errors) | ||
|
|
||
| # ── form_classes path ──────────────────────────────────────────────── |
Member
There was a problem hiding this comment.
Do you think this should be split out to its own function?
Contributor
Author
|
i made the changes |
Member
|
@JohananOppongAmoateng Can you rebase this PR so it can be merged cleanly? |
c16abb2 to
fc625b9
Compare
Contributor
Author
done |
fc625b9 to
05b872e
Compare
Contributor
Author
|
@adamghill i fixed the conflicts you should be able to merge it now |
b06c28c to
f10c03c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for validating component fields that are objects (e.g.
company.email) by introducing aform_classesattribute onUnicornView.Previously,
form_classonly worked when component properties directly matched form field names (e.g.unicorn:model="email"). However, it did not support nested/object fields such as:This limitation made it difficult to use
ModelFormvalidation when binding directly to model instances inside a component. Closes #220