Below is my view function to retrieve month values from a QuerySet:

def year_get_months(request, year, template_name):

    months = Letter.objects.filter(
        date_published__year = year
        ).dates('date_published', 'month')

    return render_to_response(
        template_name, context_instance = RequestContext(
            request, {
                'months': list(months),
            })
    )

I have just noticed a problem when the result is an empty list when there 
is only one record in database for a particular year. I have also 
observed that the first object in a returned list is also missing. Could 
this be a bug?

I'm running the latest development version of Django (#5146) and Python 
2.5

Has anyone else noticed it? If there's something wrong in the way I'm 
doing it here, please let me know. Before I fill out a bug report, I'd 
like to ask if anyone has been faced with this issue.

Patrick Anderson


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to