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
File "/home/codie/Projects/blogstorm.ai/backend_blogstorm/writer/schemas/__init__.py", line 15, in <module>
class WriterContentSchema(ModelSchema):
File "/home/codie/Projects/blogstorm.ai/backend_blogstorm/venv/lib/python3.11/site-packages/ninja/orm/metaclass.py", line 63, in __new__
model_schema = create_schema(
^^^^^^^^^^^^^^
File "/home/codie/Projects/blogstorm.ai/backend_blogstorm/venv/lib/python3.11/site-packages/ninja/orm/factory.py", line 59, in create_schema
python_type, field_info = get_schema_field(fld, depth=depth)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/codie/Projects/blogstorm.ai/backend_blogstorm/venv/lib/python3.11/site-packages/ninja/orm/fields.py", line 118, in get_schema_field
internal_type = field.related_model._meta.pk.get_internal_type()
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute '_meta'
Note: It works super well when I change the model to something that is not an abstract model and is inherited from ContentGenericModel.
Versions (please complete the following information):
Python version: 3.11.2
Django version: 4.1.6
Django-Ninja version: 0.22.2
Pydantic version: 1.10.13
The text was updated successfully, but these errors were encountered:
Currently, I am using hand-written manual schema for the purpose of being fulfilled. I am sorry, if that's what we are meant to do, I am okay with that :)
I wanted to generate an
inheritable
model schema for an abstract modelContentGenericModel
, which seems to be not possible at the moment.I am getting following issues:
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: