From 46edf54e22c831e41456920f33d933a8abe20927 Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Mon, 5 Apr 2021 10:31:46 +0200 Subject: [PATCH] Update fk_display.rst Spotted a typo --- docs/fk_display.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fk_display.rst b/docs/fk_display.rst index 13f9c9a..db8406d 100644 --- a/docs/fk_display.rst +++ b/docs/fk_display.rst @@ -1,7 +1,7 @@ How to change ForeignKey display text in dropdowns? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -:code:`Hero` has a FK to :code:`Catgeory`. In the dropdown, rather than just the name, you want to show the text "Category: ". +:code:`Hero` has a FK to :code:`Category`. In the dropdown, rather than just the name, you want to show the text "Category: ". You can change the :code:`__str__` method on :code:`Category`, but you only want this change in the admin. You can do this by creating a subclassing :code:`forms.ModelChoiceField` with a custom :code:`label_from_instance`.::