On 11/11/06, Rob Slotboom <[EMAIL PROTECTED]> wrote:
>return [Poll.__class__(*row) for row in cursor.fetchall()]
This is the problematic line; to instantiate a Poll, you'll want to
either call its constructor -- Poll() -- or use the 'create()' method
of its default manager (probably 'Poll.obj
In a models.py I have created the folowing function. Top level, not in
a class.
def get_unvoted_polls_for_voter_ip(ip):
from django.db import connection
cursor = connection.cursor()
sql = """SELECT polls_poll.* FROM polls_poll
LEFT OUTER JOIN polls_vote ON polls_poll.id = polls_vot
In a models.py I have created the folowing function. Top level, not in
a class.
def get_unvoted_polls_for_voter_ip(ip):
from django.db import connection
cursor = connection.cursor()
sql = """SELECT polls_poll.* FROM polls_poll
LEFT OUTER JOIN polls_vote ON polls_poll.id = polls_vot
3 matches
Mail list logo