Hi Rob,
Rob Slotboom wrote:
> I found a solution using a custom query in models.py
>
> def get_unvoted_polls_for_voter_ip(ip):
>from django.db import connection
>cursor = connection.cursor()
>sql = """SELECT polls_poll.id, polls_poll.question FROM polls_poll
> LEFT OUTER JOIN p
I found a solution using a custom query in models.py
def get_unvoted_polls_for_voter_ip(ip):
from django.db import connection
cursor = connection.cursor()
sql = """SELECT polls_poll.id, polls_poll.question FROM polls_poll
LEFT OUTER JOIN polls_vote ON polls_poll.id = polls_vote.pol
-- continue --
Entering the next query in psql returns the correct collection:
SELECT polls_poll.*, polls_vote.voter_ip FROM polls_pol
LEFT OUTER JOIN polls_vote ON polls_poll.id = polls_vote.poll_id
WHERE polls_vote.voter_ip <> '192.168.1.10' OR polls_vote.voter_ip IS
NULL;
Can this query be co
I have a question about the database api behavior with the folowing
model
Poll --<< Choice
Poll --<< Vote
Poll
question = models.CharField(maxlength=200)
pub_date = models.DateTimeField()
Choice
poll = models.ForeignKey(Poll)
choice = models.CharField(maxlength=200)
votes = models.IntegerF