Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#21186 closed Bug (fixed)

list_filter on a date field is not working as expected

Reported by: onlygoldi2201@… Owned by: nobody
Component: contrib.admin Version: dev
Severity: Release blocker Keywords:
Cc: bmispelon@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I am new user of Django and i am learning it.

I expect books which are getting publish in future date in the current month/year to be shown when i select "this month" or "this year". But it's show results only till current date.

I am attaching some of snapshots of web page and code as well, please let me know if any other information is needed.

Attachments (3)

thismonth.png (143.6 KB ) - added by anonymous 11 years ago.
thisyear.png (129.9 KB ) - added by anonymous 11 years ago.
Anydate.png (131.7 KB ) - added by anonymous 11 years ago.

Download all attachments as: .zip

Change History (10)

by anonymous, 11 years ago

Attachment: thismonth.png added

by anonymous, 11 years ago

Attachment: thisyear.png added

by anonymous, 11 years ago

Attachment: Anydate.png added

comment:1 by Ramiro Morales, 11 years ago

Thanks for your report.

Which database backend are you using?

comment:2 by Ramiro Morales, 11 years ago

Triage Stage: UnreviewedAccepted

We've been able to reproduce this with sqlite3 and MySQL

comment:3 by Baptiste Mispelon, 11 years ago

Cc: bmispelon@… added
Severity: NormalRelease blocker
Version: 1.5master

Some digging up indicates that the regression was introduced in bf0abe0ea6cb492810c5b4f9306a19c8afe603bb.

I reproduced the issue quite simply, using the following model/modeladmin:

class Foo(models.Model):
    publication_date = models.DateField()

class FooAdmin(admin.ModelAdmin):
    list_display = ['pk', 'publication_date']
    list_filter = ['publication_date']

I created four objects with the dates provided in the original report.

comment:4 by Baptiste Mispelon <bmispelon@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 8f51ba669aba94eea684ea3f3429fd8e39e70679:

Fixed #21186: Fixed regression when using date fields in the admin's list_filter.

Thanks to onlygoldi2201 for the report and to ramiro and apollo13
for the reviews.

comment:5 by Baptiste Mispelon <bmispelon@…>, 11 years ago

In c2a35d40db3eca728ac809a3ddb5e8fcec463bca:

[1.6.x] Fixed #21186: Fixed regression when using date fields in the admin's list_filter.

Thanks to onlygoldi2201 for the report and to ramiro and apollo13
for the reviews.

Backport of 8f51ba669aba94eea684ea3f3429fd8e39e70679 from master.

in reply to:  1 comment:6 by anonymous, 11 years ago

Replying to ramiro:

Thanks for your report.

Which database backend are you using?

I am using MySql.

comment:7 by Aymeric Augustin, 11 years ago

Whoops, sorry about that. Thanks everyone for the fix.

Note: See TracTickets for help on using tickets.
Back to Top