[1.5.x] Fixed #20168 - Generalized a PostgreSQL specific database query in the docs.
Thanks Russ for the suggestion.
Backport of c119d0f152
from master
This commit is contained in:
parent
999817375b
commit
a825b1903d
|
@ -70,8 +70,8 @@ returns a list of all ``OpinionPoll`` objects, each with an extra
|
||||||
SELECT p.id, p.question, p.poll_date, COUNT(*)
|
SELECT p.id, p.question, p.poll_date, COUNT(*)
|
||||||
FROM polls_opinionpoll p, polls_response r
|
FROM polls_opinionpoll p, polls_response r
|
||||||
WHERE p.id = r.poll_id
|
WHERE p.id = r.poll_id
|
||||||
GROUP BY 1, 2, 3
|
GROUP BY p.id, p.question, p.poll_date
|
||||||
ORDER BY 3 DESC""")
|
ORDER BY p.poll_date DESC""")
|
||||||
result_list = []
|
result_list = []
|
||||||
for row in cursor.fetchall():
|
for row in cursor.fetchall():
|
||||||
p = self.model(id=row[0], question=row[1], poll_date=row[2])
|
p = self.model(id=row[0], question=row[1], poll_date=row[2])
|
||||||
|
|
Loading…
Reference in New Issue