From 53437d6d96b403dfd2fd8f8fd30c7dad545a38cf Mon Sep 17 00:00:00 2001 From: Josh Washburne Date: Mon, 8 Jan 2018 09:39:55 -0500 Subject: [PATCH] I lied--now I added the docstring. --- savepointradio/radio/signals.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/savepointradio/radio/signals.py b/savepointradio/radio/signals.py index c306a2a..eaf7b58 100644 --- a/savepointradio/radio/signals.py +++ b/savepointradio/radio/signals.py @@ -10,6 +10,11 @@ from .models import Album, Artist, Game, Song @receiver(pre_save, sender=Game) @receiver(pre_save, sender=Song) def update_sorted_fields(sender, instance, **kwargs): + """ + Whenever the name or title of a radio model object is created/modified, we + want to make sure we update the sorted field with the naturalized data for + sorting. + """ if sender == Artist: instance.sorted_full_name = naturalize(instance.full_name) else: