Filter questions with dates

閲覧: 42 回
最初の未読メッセージにスキップ

Lakshyaraj Dash

未読、
2022/10/26 0:02:162022/10/26
To: django...@googlegroups.com
I'm having a forums project in which I want to add a date filter for questions like when a user clicks on a specific date the questions related to the date will be filter like 24 Dec 2021 will show 24122022...

Ryan Nowakowski

未読、
2022/10/27 10:04:242022/10/27
To: django...@googlegroups.com
Do you already have other kinds of filters in place and just need help adding a date filter, or do you need help with filtering in general?

Lakshyaraj Dash

未読、
2022/10/27 10:09:002022/10/27
To: django...@googlegroups.com
I have search filters and tagwise filters and just want to add date filters.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/BD9E1263-A0CE-4467-8966-72BB3EF755EC%40fattuba.com.

Ryan Nowakowski

未読、
2022/10/28 9:35:102022/10/28
To: django...@googlegroups.com
Is your question around how to do the date filtering in the view or how to set up the filter in the template?

Lakshyaraj Dash

未読、
2022/10/28 10:23:312022/10/28
To: django...@googlegroups.com
I want a select menu with months and years written against the corresponding month. When I will click the filter button the blogs should be filtered with the corresponding month and year.

Ryan Nowakowski

未読、
2022/10/29 8:35:052022/10/29
To: django...@googlegroups.com、Lakshyaraj Dash
To generate the list of years for your select you can use dates [1].

[1] https://docs.djangoproject.com/en/dev/ref/models/querysets/#dates

Vitaly Bogomolov

未読、
2022/10/29 11:25:532022/10/29
To: Django users
You can try to use DateRange or DateRangePicker filter from my DjangoAdminFilters library.

django-filters.PNG


пятница, 28 октября 2022 г. в 18:23:31 UTC+4, dashlaksh...@gmail.com:

M Adnan

未読、
2022/10/29 11:36:382022/10/29
To: django...@googlegroups.com
Filter as created_at__lte or created_at__gte it's depends on your requirements 

Lakshyaraj Dash

未読、
2022/10/29 11:41:422022/10/29
To: django...@googlegroups.com
Dear Vitaly,
I want the filters using form select field in my template no in the admin 

全員に返信
投稿者に返信
転送
新着メール 0 件