Closed fegamon closed 5 months ago
looks like you have
class Meta:
model: models.Users
rather than
class Meta:
model = models.Users
can you try changing that?
The solution was set fields from model's columns:
class Users(SQLAlchemyAutoSchema):
class Meta:
model: models.Users
include_fk = True
fields = models.Users.__table__.columns.keys() # This is the solution
I'll keep this issue for people who are facing the same problem.
I have this shema:
The model is:
As you can see, the columns in the model are directly mapped from db table, and if I print columns from model, all columns are loaded, but if i print the schema, It is just an empty dict. I don't know how to load all fields without set them manually.