Get months from datefield in django -
if have datefield in django model, how can possible months values model objects? if have object1 date = 22.01.2013 , object2 date = 23.05.2013, need list of months [01, 05] or [1, 5]
you can this:
months = [i.month in mymodel.objects.values_list('date', flat=true)]
Comments
Post a Comment