Closed kmcquade closed 1 year ago
https://github.com/testdrivenio/fastapi-vue/blob/master/services/backend/src/database/models.py#L22
Currently: return f"{self.title}, {self.author_id} on {self.created_at}"
return f"{self.title}, {self.author_id} on {self.created_at}"
However, the attribute author_id does not exist.
author_id
Perhaps it should be this instead?
return f"{self.title}, {self.author}, {self.id} on {self.created_at}"
@kmcquade according to the tortoise docs, using {FK_name}_id should return the id of the related model.
So it's not an issue, {self.author_id} with return the id of the related author.
https://github.com/testdrivenio/fastapi-vue/blob/master/services/backend/src/database/models.py#L22
Currently:
return f"{self.title}, {self.author_id} on {self.created_at}"
However, the attribute
author_id
does not exist.Perhaps it should be this instead?
return f"{self.title}, {self.author}, {self.id} on {self.created_at}"