Ticket #5030: aggregateDiff.diff
File aggregateDiff.diff, 957 bytes (added by , 17 years ago) |
---|
-
base.py
213 210 record_exists = True 214 211 if pk_set: 215 212 # Determine whether a record with the primary key already exists. 216 cursor.execute("SELECT COUNT(*)FROM %s WHERE %s=%%s" % \213 cursor.execute("SELECT 1 FROM %s WHERE %s=%%s" % \ 217 214 (backend.quote_name(self._meta.db_table), backend.quote_name(self._meta.pk.column)), 218 215 self._meta.pk.get_db_prep_lookup('exact', pk_val)) 219 216 # If it does already exist, do an UPDATE. 220 if cursor.fetchone() [0] > 0:217 if cursor.fetchone(): 221 218 db_values = [f.get_db_prep_save(raw and getattr(self, f.attname) or f.pre_save(self, False)) for f in non_pks] 222 219 if db_values: 223 220 cursor.execute("UPDATE %s SET %s WHERE %s=%%s" % \