Ticket #4736: manual_pk_quote.diff

File manual_pk_quote.diff, 874 bytes (added by Antti Kaihola, 17 years ago)

adds manual pk column name quoting to the save() method

  • django/db/models/base.py

     
    232232            db_values = [f.get_db_prep_save(f.pre_save(self, True)) for f in self._meta.fields if not isinstance(f, AutoField)]
    233233            # If the PK has been manually set, respect that.
    234234            if pk_set:
    235                 field_names += [f.column for f in self._meta.fields if isinstance(f, AutoField)]
     235                field_names += [backend.quote_name(f.column) for f in self._meta.fields if isinstance(f, AutoField)]
    236236                db_values += [f.get_db_prep_save(f.pre_save(self, True)) for f in self._meta.fields if isinstance(f, AutoField)]
    237237            placeholders = ['%s'] * len(field_names)
    238238            if self._meta.order_with_respect_to:
Back to Top