I lied--now I added the docstring.
This commit is contained in:
parent
770bf23f15
commit
53437d6d96
1 changed files with 5 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue