On 5/4/07, Patrick Anderson <[EMAIL PROTECTED]> wrote:
>
> 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 can't see anything obviously wrong in what you describe, so it is
possible you have found a bug.
The best way to get your bug acknowledged and fixed is to submit a
patch to the Django system tests. In particular, the basic model
tests:
tests/modeltests/basic/models.py
tests the 'dates()' functionality; if you can add something to that
test that demonstrates your bug case, it will make isolating (and
fixing) the problem much easier.
Yours,
Russ Magee %-)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---