Different types with the same name in the schema - Django fields with choices
See original GitHub issueHi,
When you try to create a model with choices field and then create a second model which inherit from the previous one, you will receive error while schema generating.
Here you have a simple project with models and basic configuration. Try to generate schema and you will get following error:
AssertionError: Found different types with the same name in the schema: PageType, PageType.
It seems that it is unable to inherit models with choices fields.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:21
- Comments:47 (13 by maintainers)
Top Results From Across the Web
AssertionError: Found different types with the same name in ...
I was having the same issue. In my particular case the issue is a conflict internal workings of SQLAlchemy when a backref is...
Read more >Model field reference - Django documentation
Though you can define a choices list outside of a model class and then refer to it, defining the choices and names for...
Read more >Django models: Declaring a list of available choices in the ...
Choosing the right way to declare a list of available choices passed to Django model fields may be a problem. How to solve...
Read more >Python Examples of graphene.Field - ProgramCreek.com
You may also want to check out all available functions/classes of the module ... AssertionError: Found different types # with the same name...
Read more >Django model data types
For example, Django model field parameters like choices enforce a field's values conform to a set of choices, this type of rule is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems you’re not allowed to include
type
in your field’s name. I triedtype = models.CharField()
andfoo_type = models.CharField()
and both caused that error.When I changed the field’s name to
foo
the error was gone.Is it documented anywhere that we can not use field name
type
in models when using this library?