From cb589e8b7fdfe70ac5c9cc0b3757040c8e0da308 Mon Sep 17 00:00:00 2001 From: Tech_Dave <139209319+LetcodeitwithDave@users.noreply.github.com> Date: Sun, 8 Oct 2023 11:16:35 +0100 Subject: [PATCH] Update models.py I used the simplest method of using the f-string, so as to shortened the code and give us the same results --- blog/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/models.py b/blog/models.py index bd5695d..c54d7f6 100755 --- a/blog/models.py +++ b/blog/models.py @@ -39,4 +39,4 @@ class Meta: ordering = ["created_on"] def __str__(self): - return "Comment {} by {}".format(self.body, self.name) + return f"Comment {self.body} by {self.name}"