Skip to content

feat: add early fk_field configuration validation#10

Merged
tnware merged 1 commit intomainfrom
feat/issue-3-validate-fk-field
Mar 5, 2026
Merged

feat: add early fk_field configuration validation#10
tnware merged 1 commit intomainfrom
feat/issue-3-validate-fk-field

Conversation

@tnware
Copy link
Copy Markdown
Owner

@tnware tnware commented Mar 5, 2026

Summary

  • validate reverse relation config early during form setup
  • raise ImproperlyConfigured when fk_field does not exist on the reverse model
  • raise ImproperlyConfigured when fk_field is not a ForeignKey or OneToOneField
  • raise ImproperlyConfigured when fk_field points to a different parent model than the admin model
  • add edge-case tests for all three invalid configuration scenarios

Validation

  • uv run python manage.py test

Closes #3

@tnware tnware merged commit aa110f4 into main Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add early validation for fk_field configuration

1 participant