Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from polls.models import Question, Choice
- Question.objects.all()
- <QuerySet [<Question: Hello, I am changed>]>
- q = Question.objects.get(pk=1)
- q.choice_set.all()
- <QuerySet [<Choice: Not much>, <Choice: Not much>, <Choice: Not much>,
- <Choice: Not much>, <Choice: Not much>, <Choice: Just hacking again>]>
- temp = q.choice_set.filter(choice_text__startswith='Just hacking')
- temp
- <QuerySet [<Choice: Just hacking again>]>
- temp.detele()
- Traceback (most recent call last):
- File "<console>", line 1, in <module>
- AttributeError: 'QuerySet' object has no attribute 'detele'
Add Comment
Please, Sign In to add comment