python - I want make a query in django opposing of where? -


e.g have models

class question(models.model):     question = models.charfield(max_length="200")  class answer(models.model):     question= models.foreignkey(question) 

so, want question's don't have in answers

e.g in answer have

question 1 question 2 

and in question have

question 1 question 2 question 3 question 4 

and want result of query question 3 , question 4

thanks

i think want is:

unanswered_questions = question.objects.filter(answer__isnull=true) 

Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

c# - how to write client side events functions for the combobox items -

ssh client with paramiko (python) -