Ticket #15209: with_clause_allow.diff

File with_clause_allow.diff, 620 bytes (added by carbonXT, 5 years ago)
  • django/db/models/sql/query.py

     
    6363                for column_meta in self.cursor.description]
    6464
    6565    def validate_sql(self, sql):
    66         if not sql.lower().strip().startswith('select'):
     66        if not sql.lower().strip().startswith(('select', 'with')):
    6767            raise InvalidQuery('Raw queries are limited to SELECT queries. Use '
    6868                               'connection.cursor directly for other types of queries.')
    6969
Back to Top