'Return a quoted list of arguments for the SELECT FOR UPDATE OF part of
the query.'

def get_select_for_update_of_arguments(self):

    def _get_field_choices():
        'Yield    all    allowed    field    paths    in    breadth-first    search    order.'
        queue = collections.deque([(None, self.klass_info)])
        while queue:
            (parent_path, klass_info) = queue.popleft()
            if (parent_path is None):
                path = []
                (yield 'self')
            else:
                path = (parent_path + [klass_info['field'].name])
                (yield LOOKUP_SEP.join(path))
            queue.extend(((path, klass_info) for klass_info in klass_info.get('related_klass_infos', [])))
    result = []
    invalid_names = []
    for name in self.query.select_for_update_of:
        parts = ([] if (name == 'self') else name.split(LOOKUP_SEP))
        klass_info = self.klass_info
        for part in parts:
            for related_klass_info in klass_info.get('related_klass_infos', []):
                if (related_klass_info['field'].name == part):
                    klass_info = related_klass_info
                    break
            else:
                klass_info = None
                break
        if (klass_info is None):
            invalid_names.append(name)
            continue
        select_index = klass_info['select_fields'][0]
        col = self.select[select_index][0]
        if self.connection.features.select_for_update_of_column:
            result.append(self.compile(col)[0])
        else:
            result.append(self.quote_name_unless_alias(col.alias))
    if invalid_names:
        raise FieldError(('Invalid    field    name(s)    given    in    select_for_update(of=(...)):    %s.    Only    relational    fields    followed    in    the    query    are    allowed.    Choices    are:    %s.' % (',    '.join(invalid_names), ',    '.join(_get_field_choices()))))
    return result
