Guest User

Untitled

a guest
Dec 15th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. from polls.models import Question, Choice
  2. Question.objects.all()
  3. <QuerySet [<Question: Hello, I am changed>]>
  4. q = Question.objects.get(pk=1)
  5. q.choice_set.all()
  6. <QuerySet [<Choice: Not much>, <Choice: Not much>, <Choice: Not much>,
  7. <Choice: Not much>, <Choice: Not much>, <Choice: Just hacking again>]>
  8. temp = q.choice_set.filter(choice_text__startswith='Just hacking')
  9. temp
  10. <QuerySet [<Choice: Just hacking again>]>
  11. temp.detele()
  12. Traceback (most recent call last):
  13. File "<console>", line 1, in <module>
  14. AttributeError: 'QuerySet' object has no attribute 'detele'
Add Comment
Please, Sign In to add comment