public function validateSortField(SS_List $list)
    {
        $field = $this->getSortField();

        // Check extra fields on many many relation types
        if ($list instanceof ManyManyList) {
            $extra = $list->getExtraFields();

            if ($extra && array_key_exists($field, $extra)) {
                return;
            }
        } elseif ($list instanceof ManyManyThroughList) {
            $manipulator = $this->getManyManyInspector($list);
            $fieldTable = DataObject::getSchema()->tableForField($manipulator->getJoinClass(), $field);
            if ($fieldTable) {
                return;
            }
        }

        $classes = ClassInfo::dataClassesFor($list->dataClass());

        foreach ($classes as $class) {
            if (singleton($class)->hasDataBaseField($field)) {
                return;
            }
        }

        throw new Exception("Couldn't find the sort field '" . $field . "'");
    }