From 15594c434991f38b386dfce96552fe30ee06e522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 16 Aug 2020 18:15:28 +0800 Subject: [PATCH] Added type hint to the return types of the get_context_data and get_form methods in FormView in the Mia core application. --- mia_core/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mia_core/views.py b/mia_core/views.py index 3d51720..88be9c1 100644 --- a/mia_core/views.py +++ b/mia_core/views.py @@ -18,7 +18,7 @@ """The views of the Mia core application. """ -from typing import Dict, Type, Optional +from typing import Dict, Type, Optional, Any from dirtyfields import DirtyFieldsMixin from django import forms @@ -120,11 +120,11 @@ class FormView(View): self._is_object_requested = True return self._object - def get_context_data(self, **kwargs): + def get_context_data(self, **kwargs) -> Dict[str, Any]: """Returns the context data for the template.""" return {self.context_object_name: self.get_form()} - def get_form(self, **kwargs): + def get_form(self, **kwargs) -> forms.Form: """Returns the form for the template.""" previous_post = stored_post.get_previous_post(self.request) if previous_post is not None: