def METHOD_NAME(self, name, halo_alias, timestep_alias):
    if name == 'weight':
        return self._link_orm_class.weight.desc()
    elif name == 'time_asc':
        return timestep_alias.time_gyr
    elif name == 'time_desc':
        return timestep_alias.time_gyr.desc()
    elif name == 'halo_number_asc':
        return halo_alias.halo_number
    elif name == 'halo_number_desc':
        return halo_alias.halo_number.desc()
    else:
        raise ValueError("Unknown ordering method %r" % name)