Ticket #14019: 13448.diff

File 13448.diff, 849 bytes (added by Mark Lavin, 14 years ago)
  • django/db/models/sql/compiler.py

     
    771771        values = [self.placeholder(*v) for v in self.query.values]
    772772        result.append('VALUES (%s)' % ', '.join(values))
    773773        params = self.query.params
    774         if self.return_id and self.connection.features.can_return_id_from_insert:
     774        return_id = False
     775        if hasattr(self, 'return_id'):
     776            return_id = self.return_id
     777        if return_id and self.connection.features.can_return_id_from_insert:
    775778            col = "%s.%s" % (qn(opts.db_table), qn(opts.pk.column))
    776779            r_fmt, r_params = self.connection.ops.return_insert_id()
    777780            result.append(r_fmt % col)
Back to Top