244 | | # TODO: This assumes the database supports subqueries. |
245 | | placeholders.append('(SELECT COUNT(*) FROM %s WHERE %s = %%s)' % \ |
246 | | (qn(self._meta.db_table), qn(self._meta.order_with_respect_to.column))) |
247 | | db_values.append(getattr(self, self._meta.order_with_respect_to.attname)) |
| 244 | placeholders.append('%s') |
| 245 | subsel = 'SELECT COUNT(*) FROM %s WHERE %s = %%s' % ( |
| 246 | qn(self._meta.db_table), |
| 247 | qn(self._meta.order_with_respect_to.column)) |
| 248 | cursor.execute(subsel, (getattr(self, self._meta.order_with_respect_to.attname),)) |
| 249 | db_values.append(cursor.fetchone()[0]) |