Skip to content

Add django.Model as an output type #2426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

theadriangreen
Copy link

This is an implementation that adds Django models as an output type as per #2272

ForeignKey relationships are not handled since they can get quite complicated.

Copy link

codecov bot commented Jun 19, 2025

Codecov Report

Attention: Patch coverage is 61.90476% with 80 lines in your changes missing coverage. Please review.

Project coverage is 97.23%. Comparing base (cb7ee07) to head (9a0487c).

Files with missing lines Patch % Lines
src/datamodel_code_generator/model/django.py 46.93% 56 Missing and 22 partials ⚠️
src/datamodel_code_generator/model/__init__.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2426      +/-   ##
==========================================
- Coverage   98.13%   97.23%   -0.91%     
==========================================
  Files          66       68       +2     
  Lines        8242     8451     +209     
  Branches      827      874      +47     
==========================================
+ Hits         8088     8217     +129     
- Misses        115      173      +58     
- Partials       39       61      +22     
Flag Coverage Δ
unittests 97.23% <61.90%> (-0.91%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Copy link

codspeed-hq bot commented Jun 19, 2025

CodSpeed Performance Report

Merging #2426 will not alter performance

Comparing theadriangreen:django-output (9a0487c) with main (cb7ee07)

Summary

✅ 32 untouched benchmarks

Copy link
Owner

@koxudaxi koxudaxi left a comment

Choose a reason for hiding this comment

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

@theadriangreen
Thank you for creating the PR.
Could you please fix the unittest errors?

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.

2 participants