@register.filter
def sort_version_aware(versions):
 return sorted(versions, key=(lambda version: comparable_version(version.verbose_name)), reverse=True)

@ register . filter def sort_version_aware ( versions ) : return sorted ( versions , key = ( lambda version : comparable_version ( version . verbose_name ) ) , reverse = True )
takes a list of versions objects and sort them using version schemes .