You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have 2 schemas which are not related to each other.
Both are ModelSchemas with a status field and both have a type annotation for it:
StatusChoices is a subclass of a regular django model.
This results in a generated StatusChoices schema which is the same for both.
This means, that every field which have a StatusChoices will display the wrong values.
The proposed solution would be to include the parent class name:
OrganizationRelationStatusChoices
ReportStatusStatusChoices
Alternatively give the option to define a name for the generated schema field.
Since it is a sub-class, you can't import it as an alias and defining a variable like OrganizationRelationStatusChoices = OrganizationRelation.StatusChoices also results in a StatusChoices schema generated.
Versions (please complete the following information):
Python version: 3.13.1
Django version: 5.0
Django-Ninja version: 1.3.0
Pydantic version: 2.10.4
The text was updated successfully, but these errors were encountered:
Describe the bug
I have 2 schemas which are not related to each other.
Both are ModelSchemas with a status field and both have a type annotation for it:
StatusChoices is a subclass of a regular django model.
This results in a generated StatusChoices schema which is the same for both.
This means, that every field which have a StatusChoices will display the wrong values.
The proposed solution would be to include the parent class name:
Alternatively give the option to define a name for the generated schema field.
Since it is a sub-class, you can't import it as an alias and defining a variable like
OrganizationRelationStatusChoices = OrganizationRelation.StatusChoices
also results in a StatusChoices schema generated.Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: