def _generate_parts(self):
        tokens = self.tokens
        parts = []

        self.column_classes = [self._column_builder(c) for c in tokens.columns] if tokens.columns != '*' else None

        if not isinstance(tokens.tables[0][0], basestring):
            self._table_subquery = Query(tokens.tables[0][0])

        if tokens.where:
            func = eval("lambda row:"+self._filter_builder(tokens.where))
            parts.append(partial(Filter, function=func))
        if tokens.groupby:
            # Group by query
            parts.append(partial(GroupBy,
                    group_by = [c[0] for c in tokens.groupby],
                    columns = self.column_classes))
        elif self.column_classes and any(len(c.name)>1 for c in tokens.columns):
            # Aggregate query
            parts.append(partial(Aggregator, columns=self.column_classes))
        else:
            # Basic select
            parts.append(partial(Selector, columns=[(c.name[0], c.alias) for c in tokens.columns] if tokens.columns != '*' else None))
        if tokens.orderby:
            order = tokens.orderby
            parts.append(partial(OrderBy, order_by=order[0][0], descending=order[1]=='DESC' if len(order) > 1 else False))
        if tokens.limit or tokens.offset:
            parts.append(partial(LimitOffset,
                limit = int(tokens.limit) if tokens.limit else None,
                offset = int(tokens.offset) if tokens.offset else 0))

        return parts
Content-Type of the default error responses is text/html. Refs #20822.
dataset/ETHPy150Open samuel/squawk/squawk/query.py/Query._generate_parts--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/tests/view_tests/tests/test_defaults.py/DefaultsTests.test_default_content_type_is_text_html