Merge pull request '#55: La recherche d'épisode par date ne fonctionne pas' (#59) from fix-1.0-55 into develop-1.0
Reviewed-on: #59
This commit is contained in:
commit
dfc8f6a09c
|
@ -59,7 +59,8 @@ class EpisodeAdminForm(ModelForm):
|
||||||
class EpisodeAdmin(PageAdmin):
|
class EpisodeAdmin(PageAdmin):
|
||||||
form = EpisodeAdminForm
|
form = EpisodeAdminForm
|
||||||
list_display = PageAdmin.list_display
|
list_display = PageAdmin.list_display
|
||||||
list_filter = PageAdmin.list_filter + ('diffusion__start',)
|
list_filter = tuple(f for f in PageAdmin.list_filter if f != 'pub_date') + \
|
||||||
|
('diffusion__start', 'pub_date')
|
||||||
search_fields = PageAdmin.search_fields + ('parent__title',)
|
search_fields = PageAdmin.search_fields + ('parent__title',)
|
||||||
# readonly_fields = ('parent',)
|
# readonly_fields = ('parent',)
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,10 @@ class DateFieldFilter(filters.FieldListFilter):
|
||||||
self.date_params = {k: v for k, v in params.items()
|
self.date_params = {k: v for k, v in params.items()
|
||||||
if k.startswith(self.field_generic)}
|
if k.startswith(self.field_generic)}
|
||||||
|
|
||||||
|
exact_lookup = 'date' if isinstance(field, models.DateTimeField) else 'exact'
|
||||||
|
|
||||||
# links as: (label, param, input_type|None, value)
|
# links as: (label, param, input_type|None, value)
|
||||||
self.links = [(_('Exact'), self.field_generic + 'exact', self.input_type),
|
self.links = [(_('Exact'), self.field_generic + exact_lookup, self.input_type),
|
||||||
(_('Since'), self.field_generic + 'gte', self.input_type),
|
(_('Since'), self.field_generic + 'gte', self.input_type),
|
||||||
(_('Until'), self.field_generic + 'lte', self.input_type)]
|
(_('Until'), self.field_generic + 'lte', self.input_type)]
|
||||||
if field.null:
|
if field.null:
|
||||||
|
|
|
@ -264,7 +264,7 @@ msgstr "catégorie"
|
||||||
|
|
||||||
#: aircox/models/page.py:165
|
#: aircox/models/page.py:165
|
||||||
msgid "publication date"
|
msgid "publication date"
|
||||||
msgstr "date de publications"
|
msgstr "date de publication"
|
||||||
|
|
||||||
#: aircox/models/page.py:167
|
#: aircox/models/page.py:167
|
||||||
msgid "featured"
|
msgid "featured"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user