Created
March 23, 2010 20:54
-
-
Save vbmendes/341639 to your computer and use it in GitHub Desktop.
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
from django.db import connection | |
from agenda.models import Evento | |
Evento.objects.extra( | |
select={ | |
'month': connection.ops.date_extract_sql('month', 'data'), | |
'year': connection.ops.date_extract_sql('year', 'data'), | |
}).values('month', 'year').distinct() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment