| 173 | for view in with_clause.with_clause_inline_views) |
| 174 | |
| 175 | def _write_select_clause(self, select_clause): |
| 176 | if hasattr(select_clause, 'star_prefix'): |
| 177 | # This is a little hack to get query flattening to work (look at query_flattener.py |
| 178 | # TODO: Add proper support for SELECT *, and SELECT table_name.* |
| 179 | return 'SELECT %s.*' % select_clause.star_prefix |
| 180 | sql = 'SELECT' |
| 181 | if select_clause.distinct: |
| 182 | sql += ' DISTINCT' |
| 183 | sql += '\n' + ',\n'.join(self._write(item) for item in select_clause.items) |
| 184 | return sql |
| 185 | |
| 186 | def _write_select_item(self, select_item): |
| 187 | if select_item.alias: |