@@ -147,14 +147,9 @@ def task_metadata(cls) -> Mapped[dict[str, Any] | None]:
147147 @override
148148 def __repr__ (self ) -> str :
149149 """Return a string representation of the task."""
150- repr_template = (
151- '<{CLS}(id="{ID}", context_id="{CTX_ID}", status="{STATUS}")>'
152- )
153- return repr_template .format (
154- CLS = self .__class__ .__name__ ,
155- ID = self .id ,
156- CTX_ID = self .context_id ,
157- STATUS = self .status ,
150+ return (
151+ f'<{ self .__class__ .__name__ } (id="{ self .id } ", '
152+ f'context_id="{ self .context_id } ", status="{ self .status } ")>'
158153 )
159154
160155
@@ -188,12 +183,9 @@ class TaskModel(TaskMixin, base): # type: ignore
188183 @override
189184 def __repr__ (self ) -> str :
190185 """Return a string representation of the task."""
191- repr_template = '<TaskModel[{TABLE}](id="{ID}", context_id="{CTX_ID}", status="{STATUS}")>'
192- return repr_template .format (
193- TABLE = table_name ,
194- ID = self .id ,
195- CTX_ID = self .context_id ,
196- STATUS = self .status ,
186+ return (
187+ f'<TaskModel[{ table_name } ](id="{ self .id } ", '
188+ f'context_id="{ self .context_id } ", status="{ self .status } ")>'
197189 )
198190
199191 # Set a dynamic name for better debugging
@@ -221,11 +213,9 @@ class PushNotificationConfigMixin:
221213 @override
222214 def __repr__ (self ) -> str :
223215 """Return a string representation of the push notification config."""
224- repr_template = '<{CLS}(task_id="{TID}", config_id="{CID}")>'
225- return repr_template .format (
226- CLS = self .__class__ .__name__ ,
227- TID = self .task_id ,
228- CID = self .config_id ,
216+ return (
217+ f'<{ self .__class__ .__name__ } (task_id="{ self .task_id } ", '
218+ f'config_id="{ self .config_id } ")>'
229219 )
230220
231221
@@ -241,11 +231,9 @@ class PushNotificationConfigModel(PushNotificationConfigMixin, base): # type: i
241231 @override
242232 def __repr__ (self ) -> str :
243233 """Return a string representation of the push notification config."""
244- repr_template = '<PushNotificationConfigModel[{TABLE}](task_id="{TID}", config_id="{CID}")>'
245- return repr_template .format (
246- TABLE = table_name ,
247- TID = self .task_id ,
248- CID = self .config_id ,
234+ return (
235+ f'<PushNotificationConfigModel[{ table_name } ]('
236+ f'task_id="{ self .task_id } ", config_id="{ self .config_id } ")>'
249237 )
250238
251239 PushNotificationConfigModel .__name__ = (
0 commit comments