You'll want this kind of sorting logic in the model