Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

src/q/u/quanda-HEAD/views/__init__.py   quanda(Download)
def pick_answer(request, answer_id=None):
    try:
        answer = Answer.objects.get(pk=answer_id)
    except Answer.DoesNotExist:
        raise Http404
 
    try:
        already_chosen = Answer.objects.get(question=answer.question, user_chosen=True)
        already_chosen.user_chosen = False
        already_chosen.save()