Skip to content

Conversation

@JohananOppongAmoateng
Copy link
Contributor

@JohananOppongAmoateng JohananOppongAmoateng commented Dec 20, 2025

This PR addresses #346 by adding documentation on how to handle polymorphic forms in standard Django views (outside the admin).

Closes #346

@codecov
Copy link

codecov bot commented Dec 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.98%. Comparing base (06729c3) to head (0ff5a43).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #749   +/-   ##
=======================================
  Coverage   83.98%   83.98%           
=======================================
  Files          27       27           
  Lines        1611     1611           
  Branches      253      253           
=======================================
  Hits         1353     1353           
  Misses        196      196           
  Partials       62       62           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Johanan Oppong Amoateng <[email protected]>
Co-authored-by: Brian Kohan <[email protected]>
Copy link
Collaborator

@bckohan bckohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the solid start on this @JohananOppongAmoateng

I made two major changes that you should take note of because they'll apply to other PRs:

  1. I put the example code into a test app (tests/examples/views) and then referenced it in the docs using literalinclude. The code is tested in the test.py file in that app. I'd like to follow this pattern for all code in the docs so we can be assured everything is tested.
  2. I rewrote the example to key off of model label instead of content type id. For version 5 we'll have to make this change for all the forms and so will users who've written their own forms.

@bckohan bckohan merged commit 5b4c237 into jazzband:master Jan 7, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to handle non-admin polymorphic forms?

2 participants