Created
May 5, 2012 14:36
-
-
Save gileno/2602936 to your computer and use it in GitHub Desktop.
Uso do Select Extra
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alternatives = Alternative.objects.filter(exercise=exercise) | |
select_sql = u'''select courses_solveexercise.response | |
from courses_solveexercise where | |
courses_solveexercise.user_id=%s and | |
courses_solveexercise.alternative_id=courses_alternative.id''' | |
alternatives = alternatives.extra(select=SortedDict([('user_response', select_sql)]), | |
select_params=[user.id]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment