We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a6850a commit 6a66445Copy full SHA for 6a66445
tortoise/fields/relational.py
@@ -411,7 +411,12 @@ def __init__(
411
412
def describe(self, serializable: bool) -> dict:
413
desc = super().describe(serializable)
414
- desc["model_name"] = self.model_name
+ if isinstance(self.model_name, str):
415
+ model_name = self.model_name
416
+ else:
417
+ model: type[Model] = self.model_name
418
+ model_name = f"{model._meta.app}.{model.__name__}"
419
+ desc["model_name"] = model_name
420
desc["related_name"] = self.related_name
421
desc["forward_key"] = self.forward_key
422
desc["backward_key"] = self.backward_key
0 commit comments