A better, more flexible way to handle sorting within a complex Django application.